Subversion Repositories SmartDukaan

Rev

Rev 5327 | Rev 6250 | 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
 
3430 rajveer 32
    public List<Promotion> getAllPromotions() throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 33
 
3430 rajveer 34
    public Promotion getPromotionById(long promotionId) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 35
 
3430 rajveer 36
    public void generateCouponsForPromotion(long promotionId, String couponCode) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 37
 
3430 rajveer 38
    public Cart applyCoupon(String couponCode, long cartId) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 39
 
3430 rajveer 40
    public void trackCouponUsage(String couponCode, long transactionId, long userId) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 41
 
3430 rajveer 42
    public long getCouponUsageCountByUser(String couponCode, long userId) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 43
 
3385 varun.gupt 44
    /**
45
     * Returns a list of active coupons
46
     */
3430 rajveer 47
    public List<Coupon> getActiveCoupons() throws PromotionException, org.apache.thrift.TException;
3385 varun.gupt 48
 
49
    /**
50
     * Returns the count of successful payments done using a given coupon
51
     * 
52
     * @param couponCode
53
     */
3430 rajveer 54
    public long getSuccessfulPaymentCountForCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException;
3385 varun.gupt 55
 
56
    /**
57
     * Returns the doc string of the rule module
58
     * 
59
     * @param ruleName
60
     */
3430 rajveer 61
    public String getRuleDocString(String ruleName) throws org.apache.thrift.TException;
3385 varun.gupt 62
 
4189 varun.gupt 63
    public List<ItemCouponDiscount> getItemDiscountMap(List<Long> itemIds) throws PromotionException, org.apache.thrift.TException;
64
 
4494 varun.gupt 65
    public Map<String,Double> getDiscountsForEntity(long entityId) throws org.apache.thrift.TException;
66
 
5469 rajveer 67
    public void addVoucher(Voucher voucher) throws org.apache.thrift.TException;
68
 
69
    public Voucher assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount) throws org.apache.thrift.TException;
70
 
71
    public boolean markVoucherAsRedeemed(String voucherCode, long redeemedOn) throws org.apache.thrift.TException;
72
 
1982 varun.gupt 73
  }
74
 
3430 rajveer 75
  public interface AsyncIface extends in.shop2020.generic.GenericService .AsyncIface {
1982 varun.gupt 76
 
3430 rajveer 77
    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 78
 
3430 rajveer 79
    public void getAllPromotions(org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getAllPromotions_call> resultHandler) throws org.apache.thrift.TException;
80
 
81
    public void getPromotionById(long promotionId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getPromotionById_call> resultHandler) throws org.apache.thrift.TException;
82
 
83
    public void generateCouponsForPromotion(long promotionId, String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.generateCouponsForPromotion_call> resultHandler) throws org.apache.thrift.TException;
84
 
85
    public void applyCoupon(String couponCode, long cartId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.applyCoupon_call> resultHandler) throws org.apache.thrift.TException;
86
 
87
    public void trackCouponUsage(String couponCode, long transactionId, long userId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.trackCouponUsage_call> resultHandler) throws org.apache.thrift.TException;
88
 
89
    public void getCouponUsageCountByUser(String couponCode, long userId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getCouponUsageCountByUser_call> resultHandler) throws org.apache.thrift.TException;
90
 
91
    public void getActiveCoupons(org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getActiveCoupons_call> resultHandler) throws org.apache.thrift.TException;
92
 
93
    public void getSuccessfulPaymentCountForCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getSuccessfulPaymentCountForCoupon_call> resultHandler) throws org.apache.thrift.TException;
94
 
95
    public void getRuleDocString(String ruleName, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getRuleDocString_call> resultHandler) throws org.apache.thrift.TException;
96
 
4189 varun.gupt 97
    public void getItemDiscountMap(List<Long> itemIds, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getItemDiscountMap_call> resultHandler) throws org.apache.thrift.TException;
98
 
4494 varun.gupt 99
    public void getDiscountsForEntity(long entityId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getDiscountsForEntity_call> resultHandler) throws org.apache.thrift.TException;
100
 
5469 rajveer 101
    public void addVoucher(Voucher voucher, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.addVoucher_call> resultHandler) throws org.apache.thrift.TException;
102
 
103
    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;
104
 
105
    public void markVoucherAsRedeemed(String voucherCode, long redeemedOn, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.markVoucherAsRedeemed_call> resultHandler) throws org.apache.thrift.TException;
106
 
3430 rajveer 107
  }
108
 
109
  public static class Client extends in.shop2020.generic.GenericService.Client implements Iface {
110
    public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> {
111
      public Factory() {}
112
      public Client getClient(org.apache.thrift.protocol.TProtocol prot) {
113
        return new Client(prot);
114
      }
115
      public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
116
        return new Client(iprot, oprot);
117
      }
1982 varun.gupt 118
    }
119
 
3430 rajveer 120
    public Client(org.apache.thrift.protocol.TProtocol prot)
1982 varun.gupt 121
    {
3430 rajveer 122
      super(prot, prot);
1982 varun.gupt 123
    }
124
 
3430 rajveer 125
    public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
126
      super(iprot, oprot);
1982 varun.gupt 127
    }
128
 
3430 rajveer 129
    public void createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 130
    {
131
      send_createPromotion(name, ruleExecutionSrc, startOn, endOn);
132
      recv_createPromotion();
133
    }
134
 
3430 rajveer 135
    public void send_createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn) throws org.apache.thrift.TException
1982 varun.gupt 136
    {
137
      createPromotion_args args = new createPromotion_args();
3430 rajveer 138
      args.setName(name);
139
      args.setRuleExecutionSrc(ruleExecutionSrc);
140
      args.setStartOn(startOn);
141
      args.setEndOn(endOn);
142
      sendBase("createPromotion", args);
1982 varun.gupt 143
    }
144
 
3430 rajveer 145
    public void recv_createPromotion() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 146
    {
147
      createPromotion_result result = new createPromotion_result();
3430 rajveer 148
      receiveBase(result, "createPromotion");
1982 varun.gupt 149
      if (result.pex != null) {
150
        throw result.pex;
151
      }
152
      return;
153
    }
154
 
3430 rajveer 155
    public List<Promotion> getAllPromotions() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 156
    {
157
      send_getAllPromotions();
158
      return recv_getAllPromotions();
159
    }
160
 
3430 rajveer 161
    public void send_getAllPromotions() throws org.apache.thrift.TException
1982 varun.gupt 162
    {
163
      getAllPromotions_args args = new getAllPromotions_args();
3430 rajveer 164
      sendBase("getAllPromotions", args);
1982 varun.gupt 165
    }
166
 
3430 rajveer 167
    public List<Promotion> recv_getAllPromotions() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 168
    {
169
      getAllPromotions_result result = new getAllPromotions_result();
3430 rajveer 170
      receiveBase(result, "getAllPromotions");
1982 varun.gupt 171
      if (result.isSetSuccess()) {
172
        return result.success;
173
      }
174
      if (result.pex != null) {
175
        throw result.pex;
176
      }
3430 rajveer 177
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllPromotions failed: unknown result");
1982 varun.gupt 178
    }
179
 
3430 rajveer 180
    public Promotion getPromotionById(long promotionId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 181
    {
182
      send_getPromotionById(promotionId);
183
      return recv_getPromotionById();
184
    }
185
 
3430 rajveer 186
    public void send_getPromotionById(long promotionId) throws org.apache.thrift.TException
1982 varun.gupt 187
    {
188
      getPromotionById_args args = new getPromotionById_args();
3430 rajveer 189
      args.setPromotionId(promotionId);
190
      sendBase("getPromotionById", args);
1982 varun.gupt 191
    }
192
 
3430 rajveer 193
    public Promotion recv_getPromotionById() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 194
    {
195
      getPromotionById_result result = new getPromotionById_result();
3430 rajveer 196
      receiveBase(result, "getPromotionById");
1982 varun.gupt 197
      if (result.isSetSuccess()) {
198
        return result.success;
199
      }
200
      if (result.pex != null) {
201
        throw result.pex;
202
      }
3430 rajveer 203
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPromotionById failed: unknown result");
1982 varun.gupt 204
    }
205
 
3430 rajveer 206
    public void generateCouponsForPromotion(long promotionId, String couponCode) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 207
    {
208
      send_generateCouponsForPromotion(promotionId, couponCode);
209
      recv_generateCouponsForPromotion();
210
    }
211
 
3430 rajveer 212
    public void send_generateCouponsForPromotion(long promotionId, String couponCode) throws org.apache.thrift.TException
1982 varun.gupt 213
    {
214
      generateCouponsForPromotion_args args = new generateCouponsForPromotion_args();
3430 rajveer 215
      args.setPromotionId(promotionId);
216
      args.setCouponCode(couponCode);
217
      sendBase("generateCouponsForPromotion", args);
1982 varun.gupt 218
    }
219
 
3430 rajveer 220
    public void recv_generateCouponsForPromotion() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 221
    {
222
      generateCouponsForPromotion_result result = new generateCouponsForPromotion_result();
3430 rajveer 223
      receiveBase(result, "generateCouponsForPromotion");
1982 varun.gupt 224
      if (result.pex != null) {
225
        throw result.pex;
226
      }
227
      return;
228
    }
229
 
3430 rajveer 230
    public Cart applyCoupon(String couponCode, long cartId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 231
    {
232
      send_applyCoupon(couponCode, cartId);
233
      return recv_applyCoupon();
234
    }
235
 
3430 rajveer 236
    public void send_applyCoupon(String couponCode, long cartId) throws org.apache.thrift.TException
1982 varun.gupt 237
    {
238
      applyCoupon_args args = new applyCoupon_args();
3430 rajveer 239
      args.setCouponCode(couponCode);
240
      args.setCartId(cartId);
241
      sendBase("applyCoupon", args);
1982 varun.gupt 242
    }
243
 
3430 rajveer 244
    public Cart recv_applyCoupon() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 245
    {
246
      applyCoupon_result result = new applyCoupon_result();
3430 rajveer 247
      receiveBase(result, "applyCoupon");
1982 varun.gupt 248
      if (result.isSetSuccess()) {
249
        return result.success;
250
      }
251
      if (result.pex != null) {
252
        throw result.pex;
253
      }
3430 rajveer 254
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "applyCoupon failed: unknown result");
1982 varun.gupt 255
    }
256
 
3430 rajveer 257
    public void trackCouponUsage(String couponCode, long transactionId, long userId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 258
    {
259
      send_trackCouponUsage(couponCode, transactionId, userId);
260
      recv_trackCouponUsage();
261
    }
262
 
3430 rajveer 263
    public void send_trackCouponUsage(String couponCode, long transactionId, long userId) throws org.apache.thrift.TException
1982 varun.gupt 264
    {
265
      trackCouponUsage_args args = new trackCouponUsage_args();
3430 rajveer 266
      args.setCouponCode(couponCode);
267
      args.setTransactionId(transactionId);
268
      args.setUserId(userId);
269
      sendBase("trackCouponUsage", args);
1982 varun.gupt 270
    }
271
 
3430 rajveer 272
    public void recv_trackCouponUsage() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 273
    {
274
      trackCouponUsage_result result = new trackCouponUsage_result();
3430 rajveer 275
      receiveBase(result, "trackCouponUsage");
1982 varun.gupt 276
      if (result.pex != null) {
277
        throw result.pex;
278
      }
279
      return;
280
    }
281
 
3430 rajveer 282
    public long getCouponUsageCountByUser(String couponCode, long userId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 283
    {
284
      send_getCouponUsageCountByUser(couponCode, userId);
285
      return recv_getCouponUsageCountByUser();
286
    }
287
 
3430 rajveer 288
    public void send_getCouponUsageCountByUser(String couponCode, long userId) throws org.apache.thrift.TException
1982 varun.gupt 289
    {
290
      getCouponUsageCountByUser_args args = new getCouponUsageCountByUser_args();
3430 rajveer 291
      args.setCouponCode(couponCode);
292
      args.setUserId(userId);
293
      sendBase("getCouponUsageCountByUser", args);
1982 varun.gupt 294
    }
295
 
3430 rajveer 296
    public long recv_getCouponUsageCountByUser() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 297
    {
298
      getCouponUsageCountByUser_result result = new getCouponUsageCountByUser_result();
3430 rajveer 299
      receiveBase(result, "getCouponUsageCountByUser");
1982 varun.gupt 300
      if (result.isSetSuccess()) {
301
        return result.success;
302
      }
303
      if (result.pex != null) {
304
        throw result.pex;
305
      }
3430 rajveer 306
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCouponUsageCountByUser failed: unknown result");
1982 varun.gupt 307
    }
308
 
3430 rajveer 309
    public List<Coupon> getActiveCoupons() throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 310
    {
311
      send_getActiveCoupons();
312
      return recv_getActiveCoupons();
313
    }
314
 
3430 rajveer 315
    public void send_getActiveCoupons() throws org.apache.thrift.TException
3385 varun.gupt 316
    {
317
      getActiveCoupons_args args = new getActiveCoupons_args();
3430 rajveer 318
      sendBase("getActiveCoupons", args);
3385 varun.gupt 319
    }
320
 
3430 rajveer 321
    public List<Coupon> recv_getActiveCoupons() throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 322
    {
323
      getActiveCoupons_result result = new getActiveCoupons_result();
3430 rajveer 324
      receiveBase(result, "getActiveCoupons");
3385 varun.gupt 325
      if (result.isSetSuccess()) {
326
        return result.success;
327
      }
328
      if (result.pex != null) {
329
        throw result.pex;
330
      }
3430 rajveer 331
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getActiveCoupons failed: unknown result");
3385 varun.gupt 332
    }
333
 
3430 rajveer 334
    public long getSuccessfulPaymentCountForCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 335
    {
336
      send_getSuccessfulPaymentCountForCoupon(couponCode);
337
      return recv_getSuccessfulPaymentCountForCoupon();
338
    }
339
 
3430 rajveer 340
    public void send_getSuccessfulPaymentCountForCoupon(String couponCode) throws org.apache.thrift.TException
3385 varun.gupt 341
    {
342
      getSuccessfulPaymentCountForCoupon_args args = new getSuccessfulPaymentCountForCoupon_args();
3430 rajveer 343
      args.setCouponCode(couponCode);
344
      sendBase("getSuccessfulPaymentCountForCoupon", args);
3385 varun.gupt 345
    }
346
 
3430 rajveer 347
    public long recv_getSuccessfulPaymentCountForCoupon() throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 348
    {
349
      getSuccessfulPaymentCountForCoupon_result result = new getSuccessfulPaymentCountForCoupon_result();
3430 rajveer 350
      receiveBase(result, "getSuccessfulPaymentCountForCoupon");
3385 varun.gupt 351
      if (result.isSetSuccess()) {
352
        return result.success;
353
      }
354
      if (result.pex != null) {
355
        throw result.pex;
356
      }
3430 rajveer 357
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getSuccessfulPaymentCountForCoupon failed: unknown result");
3385 varun.gupt 358
    }
359
 
3430 rajveer 360
    public String getRuleDocString(String ruleName) throws org.apache.thrift.TException
3385 varun.gupt 361
    {
362
      send_getRuleDocString(ruleName);
363
      return recv_getRuleDocString();
364
    }
365
 
3430 rajveer 366
    public void send_getRuleDocString(String ruleName) throws org.apache.thrift.TException
3385 varun.gupt 367
    {
368
      getRuleDocString_args args = new getRuleDocString_args();
3430 rajveer 369
      args.setRuleName(ruleName);
370
      sendBase("getRuleDocString", args);
3385 varun.gupt 371
    }
372
 
3430 rajveer 373
    public String recv_getRuleDocString() throws org.apache.thrift.TException
3385 varun.gupt 374
    {
375
      getRuleDocString_result result = new getRuleDocString_result();
3430 rajveer 376
      receiveBase(result, "getRuleDocString");
3385 varun.gupt 377
      if (result.isSetSuccess()) {
378
        return result.success;
379
      }
3430 rajveer 380
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getRuleDocString failed: unknown result");
3385 varun.gupt 381
    }
382
 
4189 varun.gupt 383
    public List<ItemCouponDiscount> getItemDiscountMap(List<Long> itemIds) throws PromotionException, org.apache.thrift.TException
384
    {
385
      send_getItemDiscountMap(itemIds);
386
      return recv_getItemDiscountMap();
387
    }
388
 
389
    public void send_getItemDiscountMap(List<Long> itemIds) throws org.apache.thrift.TException
390
    {
391
      getItemDiscountMap_args args = new getItemDiscountMap_args();
392
      args.setItemIds(itemIds);
393
      sendBase("getItemDiscountMap", args);
394
    }
395
 
396
    public List<ItemCouponDiscount> recv_getItemDiscountMap() throws PromotionException, org.apache.thrift.TException
397
    {
398
      getItemDiscountMap_result result = new getItemDiscountMap_result();
399
      receiveBase(result, "getItemDiscountMap");
400
      if (result.isSetSuccess()) {
401
        return result.success;
402
      }
403
      if (result.pex != null) {
404
        throw result.pex;
405
      }
406
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getItemDiscountMap failed: unknown result");
407
    }
408
 
4494 varun.gupt 409
    public Map<String,Double> getDiscountsForEntity(long entityId) throws org.apache.thrift.TException
410
    {
411
      send_getDiscountsForEntity(entityId);
412
      return recv_getDiscountsForEntity();
413
    }
414
 
415
    public void send_getDiscountsForEntity(long entityId) throws org.apache.thrift.TException
416
    {
417
      getDiscountsForEntity_args args = new getDiscountsForEntity_args();
418
      args.setEntityId(entityId);
419
      sendBase("getDiscountsForEntity", args);
420
    }
421
 
422
    public Map<String,Double> recv_getDiscountsForEntity() throws org.apache.thrift.TException
423
    {
424
      getDiscountsForEntity_result result = new getDiscountsForEntity_result();
425
      receiveBase(result, "getDiscountsForEntity");
426
      if (result.isSetSuccess()) {
427
        return result.success;
428
      }
429
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getDiscountsForEntity failed: unknown result");
430
    }
431
 
5469 rajveer 432
    public void addVoucher(Voucher voucher) throws org.apache.thrift.TException
433
    {
434
      send_addVoucher(voucher);
435
      recv_addVoucher();
436
    }
437
 
438
    public void send_addVoucher(Voucher voucher) throws org.apache.thrift.TException
439
    {
440
      addVoucher_args args = new addVoucher_args();
441
      args.setVoucher(voucher);
442
      sendBase("addVoucher", args);
443
    }
444
 
445
    public void recv_addVoucher() throws org.apache.thrift.TException
446
    {
447
      addVoucher_result result = new addVoucher_result();
448
      receiveBase(result, "addVoucher");
449
      return;
450
    }
451
 
452
    public Voucher assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount) throws org.apache.thrift.TException
453
    {
454
      send_assignVoucher(userId, userEmail, voucherType, amount);
455
      return recv_assignVoucher();
456
    }
457
 
458
    public void send_assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount) throws org.apache.thrift.TException
459
    {
460
      assignVoucher_args args = new assignVoucher_args();
461
      args.setUserId(userId);
462
      args.setUserEmail(userEmail);
463
      args.setVoucherType(voucherType);
464
      args.setAmount(amount);
465
      sendBase("assignVoucher", args);
466
    }
467
 
468
    public Voucher recv_assignVoucher() throws org.apache.thrift.TException
469
    {
470
      assignVoucher_result result = new assignVoucher_result();
471
      receiveBase(result, "assignVoucher");
472
      if (result.isSetSuccess()) {
473
        return result.success;
474
      }
475
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "assignVoucher failed: unknown result");
476
    }
477
 
478
    public boolean markVoucherAsRedeemed(String voucherCode, long redeemedOn) throws org.apache.thrift.TException
479
    {
480
      send_markVoucherAsRedeemed(voucherCode, redeemedOn);
481
      return recv_markVoucherAsRedeemed();
482
    }
483
 
484
    public void send_markVoucherAsRedeemed(String voucherCode, long redeemedOn) throws org.apache.thrift.TException
485
    {
486
      markVoucherAsRedeemed_args args = new markVoucherAsRedeemed_args();
487
      args.setVoucherCode(voucherCode);
488
      args.setRedeemedOn(redeemedOn);
489
      sendBase("markVoucherAsRedeemed", args);
490
    }
491
 
492
    public boolean recv_markVoucherAsRedeemed() throws org.apache.thrift.TException
493
    {
494
      markVoucherAsRedeemed_result result = new markVoucherAsRedeemed_result();
495
      receiveBase(result, "markVoucherAsRedeemed");
496
      if (result.isSetSuccess()) {
497
        return result.success;
498
      }
499
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "markVoucherAsRedeemed failed: unknown result");
500
    }
501
 
1982 varun.gupt 502
  }
3430 rajveer 503
  public static class AsyncClient extends in.shop2020.generic.GenericService.AsyncClient implements AsyncIface {
504
    public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
505
      private org.apache.thrift.async.TAsyncClientManager clientManager;
506
      private org.apache.thrift.protocol.TProtocolFactory protocolFactory;
507
      public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) {
508
        this.clientManager = clientManager;
509
        this.protocolFactory = protocolFactory;
510
      }
511
      public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) {
512
        return new AsyncClient(protocolFactory, clientManager, transport);
513
      }
1982 varun.gupt 514
    }
515
 
3430 rajveer 516
    public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) {
517
      super(protocolFactory, clientManager, transport);
518
    }
1982 varun.gupt 519
 
3430 rajveer 520
    public void createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn, org.apache.thrift.async.AsyncMethodCallback<createPromotion_call> resultHandler) throws org.apache.thrift.TException {
521
      checkReady();
522
      createPromotion_call method_call = new createPromotion_call(name, ruleExecutionSrc, startOn, endOn, resultHandler, this, ___protocolFactory, ___transport);
523
      this.___currentMethod = method_call;
524
      ___manager.call(method_call);
1982 varun.gupt 525
    }
526
 
3430 rajveer 527
    public static class createPromotion_call extends org.apache.thrift.async.TAsyncMethodCall {
528
      private String name;
529
      private String ruleExecutionSrc;
530
      private long startOn;
531
      private long endOn;
532
      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 {
533
        super(client, protocolFactory, transport, resultHandler, false);
534
        this.name = name;
535
        this.ruleExecutionSrc = ruleExecutionSrc;
536
        this.startOn = startOn;
537
        this.endOn = endOn;
1982 varun.gupt 538
      }
539
 
3430 rajveer 540
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
541
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createPromotion", org.apache.thrift.protocol.TMessageType.CALL, 0));
1982 varun.gupt 542
        createPromotion_args args = new createPromotion_args();
3430 rajveer 543
        args.setName(name);
544
        args.setRuleExecutionSrc(ruleExecutionSrc);
545
        args.setStartOn(startOn);
546
        args.setEndOn(endOn);
547
        args.write(prot);
548
        prot.writeMessageEnd();
1982 varun.gupt 549
      }
550
 
3430 rajveer 551
      public void getResult() throws PromotionException, org.apache.thrift.TException {
552
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
553
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 554
        }
3430 rajveer 555
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
556
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
557
        (new Client(prot)).recv_createPromotion();
1982 varun.gupt 558
      }
3430 rajveer 559
    }
1982 varun.gupt 560
 
3430 rajveer 561
    public void getAllPromotions(org.apache.thrift.async.AsyncMethodCallback<getAllPromotions_call> resultHandler) throws org.apache.thrift.TException {
562
      checkReady();
563
      getAllPromotions_call method_call = new getAllPromotions_call(resultHandler, this, ___protocolFactory, ___transport);
564
      this.___currentMethod = method_call;
565
      ___manager.call(method_call);
1982 varun.gupt 566
    }
567
 
3430 rajveer 568
    public static class getAllPromotions_call extends org.apache.thrift.async.TAsyncMethodCall {
569
      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 {
570
        super(client, protocolFactory, transport, resultHandler, false);
1982 varun.gupt 571
      }
572
 
3430 rajveer 573
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
574
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAllPromotions", org.apache.thrift.protocol.TMessageType.CALL, 0));
575
        getAllPromotions_args args = new getAllPromotions_args();
576
        args.write(prot);
577
        prot.writeMessageEnd();
578
      }
1982 varun.gupt 579
 
3430 rajveer 580
      public List<Promotion> getResult() throws PromotionException, org.apache.thrift.TException {
581
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
582
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 583
        }
3430 rajveer 584
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
585
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
586
        return (new Client(prot)).recv_getAllPromotions();
1982 varun.gupt 587
      }
3430 rajveer 588
    }
1982 varun.gupt 589
 
3430 rajveer 590
    public void getPromotionById(long promotionId, org.apache.thrift.async.AsyncMethodCallback<getPromotionById_call> resultHandler) throws org.apache.thrift.TException {
591
      checkReady();
592
      getPromotionById_call method_call = new getPromotionById_call(promotionId, resultHandler, this, ___protocolFactory, ___transport);
593
      this.___currentMethod = method_call;
594
      ___manager.call(method_call);
1982 varun.gupt 595
    }
596
 
3430 rajveer 597
    public static class getPromotionById_call extends org.apache.thrift.async.TAsyncMethodCall {
598
      private long promotionId;
599
      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 {
600
        super(client, protocolFactory, transport, resultHandler, false);
601
        this.promotionId = promotionId;
1982 varun.gupt 602
      }
603
 
3430 rajveer 604
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
605
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getPromotionById", org.apache.thrift.protocol.TMessageType.CALL, 0));
606
        getPromotionById_args args = new getPromotionById_args();
607
        args.setPromotionId(promotionId);
608
        args.write(prot);
609
        prot.writeMessageEnd();
610
      }
1982 varun.gupt 611
 
3430 rajveer 612
      public Promotion getResult() throws PromotionException, org.apache.thrift.TException {
613
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
614
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 615
        }
3430 rajveer 616
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
617
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
618
        return (new Client(prot)).recv_getPromotionById();
1982 varun.gupt 619
      }
3430 rajveer 620
    }
1982 varun.gupt 621
 
3430 rajveer 622
    public void generateCouponsForPromotion(long promotionId, String couponCode, org.apache.thrift.async.AsyncMethodCallback<generateCouponsForPromotion_call> resultHandler) throws org.apache.thrift.TException {
623
      checkReady();
624
      generateCouponsForPromotion_call method_call = new generateCouponsForPromotion_call(promotionId, couponCode, resultHandler, this, ___protocolFactory, ___transport);
625
      this.___currentMethod = method_call;
626
      ___manager.call(method_call);
1982 varun.gupt 627
    }
628
 
3430 rajveer 629
    public static class generateCouponsForPromotion_call extends org.apache.thrift.async.TAsyncMethodCall {
630
      private long promotionId;
631
      private String couponCode;
632
      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 {
633
        super(client, protocolFactory, transport, resultHandler, false);
634
        this.promotionId = promotionId;
635
        this.couponCode = couponCode;
1982 varun.gupt 636
      }
637
 
3430 rajveer 638
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
639
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("generateCouponsForPromotion", org.apache.thrift.protocol.TMessageType.CALL, 0));
640
        generateCouponsForPromotion_args args = new generateCouponsForPromotion_args();
641
        args.setPromotionId(promotionId);
642
        args.setCouponCode(couponCode);
643
        args.write(prot);
644
        prot.writeMessageEnd();
3385 varun.gupt 645
      }
646
 
3430 rajveer 647
      public void getResult() throws PromotionException, org.apache.thrift.TException {
648
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
649
          throw new IllegalStateException("Method call not finished!");
3385 varun.gupt 650
        }
3430 rajveer 651
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
652
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
653
        (new Client(prot)).recv_generateCouponsForPromotion();
3385 varun.gupt 654
      }
655
    }
656
 
3430 rajveer 657
    public void applyCoupon(String couponCode, long cartId, org.apache.thrift.async.AsyncMethodCallback<applyCoupon_call> resultHandler) throws org.apache.thrift.TException {
658
      checkReady();
659
      applyCoupon_call method_call = new applyCoupon_call(couponCode, cartId, resultHandler, this, ___protocolFactory, ___transport);
660
      this.___currentMethod = method_call;
661
      ___manager.call(method_call);
3385 varun.gupt 662
    }
663
 
3430 rajveer 664
    public static class applyCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
665
      private String couponCode;
666
      private long cartId;
667
      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 {
668
        super(client, protocolFactory, transport, resultHandler, false);
669
        this.couponCode = couponCode;
670
        this.cartId = cartId;
1982 varun.gupt 671
      }
672
 
3430 rajveer 673
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
674
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("applyCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
675
        applyCoupon_args args = new applyCoupon_args();
676
        args.setCouponCode(couponCode);
677
        args.setCartId(cartId);
678
        args.write(prot);
679
        prot.writeMessageEnd();
1982 varun.gupt 680
      }
681
 
3430 rajveer 682
      public Cart getResult() throws PromotionException, org.apache.thrift.TException {
683
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
684
          throw new IllegalStateException("Method call not finished!");
685
        }
686
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
687
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
688
        return (new Client(prot)).recv_applyCoupon();
1982 varun.gupt 689
      }
3430 rajveer 690
    }
1982 varun.gupt 691
 
3430 rajveer 692
    public void trackCouponUsage(String couponCode, long transactionId, long userId, org.apache.thrift.async.AsyncMethodCallback<trackCouponUsage_call> resultHandler) throws org.apache.thrift.TException {
693
      checkReady();
694
      trackCouponUsage_call method_call = new trackCouponUsage_call(couponCode, transactionId, userId, resultHandler, this, ___protocolFactory, ___transport);
695
      this.___currentMethod = method_call;
696
      ___manager.call(method_call);
697
    }
1982 varun.gupt 698
 
3430 rajveer 699
    public static class trackCouponUsage_call extends org.apache.thrift.async.TAsyncMethodCall {
700
      private String couponCode;
701
      private long transactionId;
702
      private long userId;
703
      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 {
704
        super(client, protocolFactory, transport, resultHandler, false);
705
        this.couponCode = couponCode;
706
        this.transactionId = transactionId;
707
        this.userId = userId;
1982 varun.gupt 708
      }
709
 
3430 rajveer 710
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
711
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("trackCouponUsage", org.apache.thrift.protocol.TMessageType.CALL, 0));
712
        trackCouponUsage_args args = new trackCouponUsage_args();
713
        args.setCouponCode(couponCode);
714
        args.setTransactionId(transactionId);
715
        args.setUserId(userId);
716
        args.write(prot);
717
        prot.writeMessageEnd();
1982 varun.gupt 718
      }
719
 
3430 rajveer 720
      public void getResult() throws PromotionException, org.apache.thrift.TException {
721
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
722
          throw new IllegalStateException("Method call not finished!");
723
        }
724
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
725
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
726
        (new Client(prot)).recv_trackCouponUsage();
1982 varun.gupt 727
      }
728
    }
729
 
3430 rajveer 730
    public void getCouponUsageCountByUser(String couponCode, long userId, org.apache.thrift.async.AsyncMethodCallback<getCouponUsageCountByUser_call> resultHandler) throws org.apache.thrift.TException {
731
      checkReady();
732
      getCouponUsageCountByUser_call method_call = new getCouponUsageCountByUser_call(couponCode, userId, resultHandler, this, ___protocolFactory, ___transport);
733
      this.___currentMethod = method_call;
734
      ___manager.call(method_call);
1982 varun.gupt 735
    }
736
 
3430 rajveer 737
    public static class getCouponUsageCountByUser_call extends org.apache.thrift.async.TAsyncMethodCall {
738
      private String couponCode;
739
      private long userId;
740
      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 {
741
        super(client, protocolFactory, transport, resultHandler, false);
742
        this.couponCode = couponCode;
743
        this.userId = userId;
744
      }
1982 varun.gupt 745
 
3430 rajveer 746
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
747
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getCouponUsageCountByUser", org.apache.thrift.protocol.TMessageType.CALL, 0));
748
        getCouponUsageCountByUser_args args = new getCouponUsageCountByUser_args();
749
        args.setCouponCode(couponCode);
750
        args.setUserId(userId);
751
        args.write(prot);
752
        prot.writeMessageEnd();
753
      }
1982 varun.gupt 754
 
3430 rajveer 755
      public long getResult() throws PromotionException, org.apache.thrift.TException {
756
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
757
          throw new IllegalStateException("Method call not finished!");
758
        }
759
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
760
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
761
        return (new Client(prot)).recv_getCouponUsageCountByUser();
762
      }
1982 varun.gupt 763
    }
764
 
3430 rajveer 765
    public void getActiveCoupons(org.apache.thrift.async.AsyncMethodCallback<getActiveCoupons_call> resultHandler) throws org.apache.thrift.TException {
766
      checkReady();
767
      getActiveCoupons_call method_call = new getActiveCoupons_call(resultHandler, this, ___protocolFactory, ___transport);
768
      this.___currentMethod = method_call;
769
      ___manager.call(method_call);
1982 varun.gupt 770
    }
771
 
3430 rajveer 772
    public static class getActiveCoupons_call extends org.apache.thrift.async.TAsyncMethodCall {
773
      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 {
774
        super(client, protocolFactory, transport, resultHandler, false);
1982 varun.gupt 775
      }
776
 
3430 rajveer 777
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
778
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getActiveCoupons", org.apache.thrift.protocol.TMessageType.CALL, 0));
779
        getActiveCoupons_args args = new getActiveCoupons_args();
780
        args.write(prot);
781
        prot.writeMessageEnd();
782
      }
1982 varun.gupt 783
 
3430 rajveer 784
      public List<Coupon> getResult() throws PromotionException, org.apache.thrift.TException {
785
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
786
          throw new IllegalStateException("Method call not finished!");
787
        }
788
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
789
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
790
        return (new Client(prot)).recv_getActiveCoupons();
1982 varun.gupt 791
      }
792
    }
793
 
3430 rajveer 794
    public void getSuccessfulPaymentCountForCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<getSuccessfulPaymentCountForCoupon_call> resultHandler) throws org.apache.thrift.TException {
795
      checkReady();
796
      getSuccessfulPaymentCountForCoupon_call method_call = new getSuccessfulPaymentCountForCoupon_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
797
      this.___currentMethod = method_call;
798
      ___manager.call(method_call);
1982 varun.gupt 799
    }
800
 
3430 rajveer 801
    public static class getSuccessfulPaymentCountForCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
802
      private String couponCode;
803
      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 {
804
        super(client, protocolFactory, transport, resultHandler, false);
805
        this.couponCode = couponCode;
1982 varun.gupt 806
      }
807
 
3430 rajveer 808
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
809
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getSuccessfulPaymentCountForCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
810
        getSuccessfulPaymentCountForCoupon_args args = new getSuccessfulPaymentCountForCoupon_args();
811
        args.setCouponCode(couponCode);
812
        args.write(prot);
813
        prot.writeMessageEnd();
814
      }
1982 varun.gupt 815
 
3430 rajveer 816
      public long getResult() throws PromotionException, org.apache.thrift.TException {
817
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
818
          throw new IllegalStateException("Method call not finished!");
819
        }
820
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
821
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
822
        return (new Client(prot)).recv_getSuccessfulPaymentCountForCoupon();
823
      }
1982 varun.gupt 824
    }
825
 
3430 rajveer 826
    public void getRuleDocString(String ruleName, org.apache.thrift.async.AsyncMethodCallback<getRuleDocString_call> resultHandler) throws org.apache.thrift.TException {
827
      checkReady();
828
      getRuleDocString_call method_call = new getRuleDocString_call(ruleName, resultHandler, this, ___protocolFactory, ___transport);
829
      this.___currentMethod = method_call;
830
      ___manager.call(method_call);
1982 varun.gupt 831
    }
832
 
3430 rajveer 833
    public static class getRuleDocString_call extends org.apache.thrift.async.TAsyncMethodCall {
834
      private String ruleName;
835
      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 {
836
        super(client, protocolFactory, transport, resultHandler, false);
837
        this.ruleName = ruleName;
838
      }
1982 varun.gupt 839
 
3430 rajveer 840
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
841
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getRuleDocString", org.apache.thrift.protocol.TMessageType.CALL, 0));
842
        getRuleDocString_args args = new getRuleDocString_args();
843
        args.setRuleName(ruleName);
844
        args.write(prot);
845
        prot.writeMessageEnd();
1982 varun.gupt 846
      }
847
 
3430 rajveer 848
      public String getResult() throws org.apache.thrift.TException {
849
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
850
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 851
        }
3430 rajveer 852
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
853
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
854
        return (new Client(prot)).recv_getRuleDocString();
1982 varun.gupt 855
      }
856
    }
857
 
4189 varun.gupt 858
    public void getItemDiscountMap(List<Long> itemIds, org.apache.thrift.async.AsyncMethodCallback<getItemDiscountMap_call> resultHandler) throws org.apache.thrift.TException {
859
      checkReady();
860
      getItemDiscountMap_call method_call = new getItemDiscountMap_call(itemIds, resultHandler, this, ___protocolFactory, ___transport);
861
      this.___currentMethod = method_call;
862
      ___manager.call(method_call);
863
    }
864
 
865
    public static class getItemDiscountMap_call extends org.apache.thrift.async.TAsyncMethodCall {
866
      private List<Long> itemIds;
867
      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 {
868
        super(client, protocolFactory, transport, resultHandler, false);
869
        this.itemIds = itemIds;
870
      }
871
 
872
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
873
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getItemDiscountMap", org.apache.thrift.protocol.TMessageType.CALL, 0));
874
        getItemDiscountMap_args args = new getItemDiscountMap_args();
875
        args.setItemIds(itemIds);
876
        args.write(prot);
877
        prot.writeMessageEnd();
878
      }
879
 
880
      public List<ItemCouponDiscount> getResult() throws PromotionException, org.apache.thrift.TException {
881
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
882
          throw new IllegalStateException("Method call not finished!");
883
        }
884
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
885
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
886
        return (new Client(prot)).recv_getItemDiscountMap();
887
      }
888
    }
889
 
4494 varun.gupt 890
    public void getDiscountsForEntity(long entityId, org.apache.thrift.async.AsyncMethodCallback<getDiscountsForEntity_call> resultHandler) throws org.apache.thrift.TException {
891
      checkReady();
892
      getDiscountsForEntity_call method_call = new getDiscountsForEntity_call(entityId, resultHandler, this, ___protocolFactory, ___transport);
893
      this.___currentMethod = method_call;
894
      ___manager.call(method_call);
895
    }
896
 
897
    public static class getDiscountsForEntity_call extends org.apache.thrift.async.TAsyncMethodCall {
898
      private long entityId;
899
      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 {
900
        super(client, protocolFactory, transport, resultHandler, false);
901
        this.entityId = entityId;
902
      }
903
 
904
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
905
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getDiscountsForEntity", org.apache.thrift.protocol.TMessageType.CALL, 0));
906
        getDiscountsForEntity_args args = new getDiscountsForEntity_args();
907
        args.setEntityId(entityId);
908
        args.write(prot);
909
        prot.writeMessageEnd();
910
      }
911
 
912
      public Map<String,Double> getResult() throws org.apache.thrift.TException {
913
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
914
          throw new IllegalStateException("Method call not finished!");
915
        }
916
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
917
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
918
        return (new Client(prot)).recv_getDiscountsForEntity();
919
      }
920
    }
921
 
5469 rajveer 922
    public void addVoucher(Voucher voucher, org.apache.thrift.async.AsyncMethodCallback<addVoucher_call> resultHandler) throws org.apache.thrift.TException {
923
      checkReady();
924
      addVoucher_call method_call = new addVoucher_call(voucher, resultHandler, this, ___protocolFactory, ___transport);
925
      this.___currentMethod = method_call;
926
      ___manager.call(method_call);
927
    }
928
 
929
    public static class addVoucher_call extends org.apache.thrift.async.TAsyncMethodCall {
930
      private Voucher voucher;
931
      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 {
932
        super(client, protocolFactory, transport, resultHandler, false);
933
        this.voucher = voucher;
934
      }
935
 
936
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
937
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("addVoucher", org.apache.thrift.protocol.TMessageType.CALL, 0));
938
        addVoucher_args args = new addVoucher_args();
939
        args.setVoucher(voucher);
940
        args.write(prot);
941
        prot.writeMessageEnd();
942
      }
943
 
944
      public void getResult() throws org.apache.thrift.TException {
945
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
946
          throw new IllegalStateException("Method call not finished!");
947
        }
948
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
949
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
950
        (new Client(prot)).recv_addVoucher();
951
      }
952
    }
953
 
954
    public void assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount, org.apache.thrift.async.AsyncMethodCallback<assignVoucher_call> resultHandler) throws org.apache.thrift.TException {
955
      checkReady();
956
      assignVoucher_call method_call = new assignVoucher_call(userId, userEmail, voucherType, amount, resultHandler, this, ___protocolFactory, ___transport);
957
      this.___currentMethod = method_call;
958
      ___manager.call(method_call);
959
    }
960
 
961
    public static class assignVoucher_call extends org.apache.thrift.async.TAsyncMethodCall {
962
      private long userId;
963
      private String userEmail;
964
      private VoucherType voucherType;
965
      private long amount;
966
      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 {
967
        super(client, protocolFactory, transport, resultHandler, false);
968
        this.userId = userId;
969
        this.userEmail = userEmail;
970
        this.voucherType = voucherType;
971
        this.amount = amount;
972
      }
973
 
974
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
975
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("assignVoucher", org.apache.thrift.protocol.TMessageType.CALL, 0));
976
        assignVoucher_args args = new assignVoucher_args();
977
        args.setUserId(userId);
978
        args.setUserEmail(userEmail);
979
        args.setVoucherType(voucherType);
980
        args.setAmount(amount);
981
        args.write(prot);
982
        prot.writeMessageEnd();
983
      }
984
 
985
      public Voucher getResult() throws org.apache.thrift.TException {
986
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
987
          throw new IllegalStateException("Method call not finished!");
988
        }
989
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
990
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
991
        return (new Client(prot)).recv_assignVoucher();
992
      }
993
    }
994
 
995
    public void markVoucherAsRedeemed(String voucherCode, long redeemedOn, org.apache.thrift.async.AsyncMethodCallback<markVoucherAsRedeemed_call> resultHandler) throws org.apache.thrift.TException {
996
      checkReady();
997
      markVoucherAsRedeemed_call method_call = new markVoucherAsRedeemed_call(voucherCode, redeemedOn, resultHandler, this, ___protocolFactory, ___transport);
998
      this.___currentMethod = method_call;
999
      ___manager.call(method_call);
1000
    }
1001
 
1002
    public static class markVoucherAsRedeemed_call extends org.apache.thrift.async.TAsyncMethodCall {
1003
      private String voucherCode;
1004
      private long redeemedOn;
1005
      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 {
1006
        super(client, protocolFactory, transport, resultHandler, false);
1007
        this.voucherCode = voucherCode;
1008
        this.redeemedOn = redeemedOn;
1009
      }
1010
 
1011
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1012
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("markVoucherAsRedeemed", org.apache.thrift.protocol.TMessageType.CALL, 0));
1013
        markVoucherAsRedeemed_args args = new markVoucherAsRedeemed_args();
1014
        args.setVoucherCode(voucherCode);
1015
        args.setRedeemedOn(redeemedOn);
1016
        args.write(prot);
1017
        prot.writeMessageEnd();
1018
      }
1019
 
1020
      public boolean getResult() throws org.apache.thrift.TException {
1021
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1022
          throw new IllegalStateException("Method call not finished!");
1023
        }
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_markVoucherAsRedeemed();
1027
      }
1028
    }
1029
 
3430 rajveer 1030
  }
1982 varun.gupt 1031
 
3430 rajveer 1032
  public static class Processor<I extends Iface> extends in.shop2020.generic.GenericService.Processor implements org.apache.thrift.TProcessor {
1033
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
1034
    public Processor(I iface) {
1035
      super(iface, getProcessMap(new HashMap<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>>()));
1982 varun.gupt 1036
    }
1037
 
3430 rajveer 1038
    protected Processor(I iface, Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> processMap) {
1039
      super(iface, getProcessMap(processMap));
1982 varun.gupt 1040
    }
1041
 
3430 rajveer 1042
    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) {
1043
      processMap.put("createPromotion", new createPromotion());
1044
      processMap.put("getAllPromotions", new getAllPromotions());
1045
      processMap.put("getPromotionById", new getPromotionById());
1046
      processMap.put("generateCouponsForPromotion", new generateCouponsForPromotion());
1047
      processMap.put("applyCoupon", new applyCoupon());
1048
      processMap.put("trackCouponUsage", new trackCouponUsage());
1049
      processMap.put("getCouponUsageCountByUser", new getCouponUsageCountByUser());
1050
      processMap.put("getActiveCoupons", new getActiveCoupons());
1051
      processMap.put("getSuccessfulPaymentCountForCoupon", new getSuccessfulPaymentCountForCoupon());
1052
      processMap.put("getRuleDocString", new getRuleDocString());
4189 varun.gupt 1053
      processMap.put("getItemDiscountMap", new getItemDiscountMap());
4494 varun.gupt 1054
      processMap.put("getDiscountsForEntity", new getDiscountsForEntity());
5469 rajveer 1055
      processMap.put("addVoucher", new addVoucher());
1056
      processMap.put("assignVoucher", new assignVoucher());
1057
      processMap.put("markVoucherAsRedeemed", new markVoucherAsRedeemed());
3430 rajveer 1058
      return processMap;
1982 varun.gupt 1059
    }
1060
 
3430 rajveer 1061
    private static class createPromotion<I extends Iface> extends org.apache.thrift.ProcessFunction<I, createPromotion_args> {
1062
      public createPromotion() {
1063
        super("createPromotion");
1064
      }
1982 varun.gupt 1065
 
3430 rajveer 1066
      protected createPromotion_args getEmptyArgsInstance() {
1067
        return new createPromotion_args();
1068
      }
1982 varun.gupt 1069
 
3430 rajveer 1070
      protected createPromotion_result getResult(I iface, createPromotion_args args) throws org.apache.thrift.TException {
1071
        createPromotion_result result = new createPromotion_result();
1072
        try {
1073
          iface.createPromotion(args.name, args.ruleExecutionSrc, args.startOn, args.endOn);
1074
        } catch (PromotionException pex) {
1075
          result.pex = pex;
1982 varun.gupt 1076
        }
3430 rajveer 1077
        return result;
1982 varun.gupt 1078
      }
3430 rajveer 1079
    }
1982 varun.gupt 1080
 
3430 rajveer 1081
    private static class getAllPromotions<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getAllPromotions_args> {
1082
      public getAllPromotions() {
1083
        super("getAllPromotions");
1982 varun.gupt 1084
      }
1085
 
3430 rajveer 1086
      protected getAllPromotions_args getEmptyArgsInstance() {
1087
        return new getAllPromotions_args();
1982 varun.gupt 1088
      }
1089
 
3430 rajveer 1090
      protected getAllPromotions_result getResult(I iface, getAllPromotions_args args) throws org.apache.thrift.TException {
1091
        getAllPromotions_result result = new getAllPromotions_result();
1092
        try {
1093
          result.success = iface.getAllPromotions();
1094
        } catch (PromotionException pex) {
1095
          result.pex = pex;
1096
        }
1097
        return result;
1982 varun.gupt 1098
      }
3430 rajveer 1099
    }
1982 varun.gupt 1100
 
3430 rajveer 1101
    private static class getPromotionById<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getPromotionById_args> {
1102
      public getPromotionById() {
1103
        super("getPromotionById");
1982 varun.gupt 1104
      }
1105
 
3430 rajveer 1106
      protected getPromotionById_args getEmptyArgsInstance() {
1107
        return new getPromotionById_args();
1982 varun.gupt 1108
      }
1109
 
3430 rajveer 1110
      protected getPromotionById_result getResult(I iface, getPromotionById_args args) throws org.apache.thrift.TException {
1111
        getPromotionById_result result = new getPromotionById_result();
1112
        try {
1113
          result.success = iface.getPromotionById(args.promotionId);
1114
        } catch (PromotionException pex) {
1115
          result.pex = pex;
1116
        }
1117
        return result;
1982 varun.gupt 1118
      }
1119
    }
1120
 
3430 rajveer 1121
    private static class generateCouponsForPromotion<I extends Iface> extends org.apache.thrift.ProcessFunction<I, generateCouponsForPromotion_args> {
1122
      public generateCouponsForPromotion() {
1123
        super("generateCouponsForPromotion");
1124
      }
1982 varun.gupt 1125
 
3430 rajveer 1126
      protected generateCouponsForPromotion_args getEmptyArgsInstance() {
1127
        return new generateCouponsForPromotion_args();
1128
      }
1982 varun.gupt 1129
 
3430 rajveer 1130
      protected generateCouponsForPromotion_result getResult(I iface, generateCouponsForPromotion_args args) throws org.apache.thrift.TException {
1131
        generateCouponsForPromotion_result result = new generateCouponsForPromotion_result();
1132
        try {
1133
          iface.generateCouponsForPromotion(args.promotionId, args.couponCode);
1134
        } catch (PromotionException pex) {
1135
          result.pex = pex;
1136
        }
1137
        return result;
1138
      }
1982 varun.gupt 1139
    }
1140
 
3430 rajveer 1141
    private static class applyCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, applyCoupon_args> {
1142
      public applyCoupon() {
1143
        super("applyCoupon");
1144
      }
1982 varun.gupt 1145
 
3430 rajveer 1146
      protected applyCoupon_args getEmptyArgsInstance() {
1147
        return new applyCoupon_args();
1148
      }
1982 varun.gupt 1149
 
3430 rajveer 1150
      protected applyCoupon_result getResult(I iface, applyCoupon_args args) throws org.apache.thrift.TException {
1151
        applyCoupon_result result = new applyCoupon_result();
1152
        try {
1153
          result.success = iface.applyCoupon(args.couponCode, args.cartId);
1154
        } catch (PromotionException pex) {
1155
          result.pex = pex;
1156
        }
1157
        return result;
1982 varun.gupt 1158
      }
1159
    }
1160
 
3430 rajveer 1161
    private static class trackCouponUsage<I extends Iface> extends org.apache.thrift.ProcessFunction<I, trackCouponUsage_args> {
1162
      public trackCouponUsage() {
1163
        super("trackCouponUsage");
1164
      }
1982 varun.gupt 1165
 
3430 rajveer 1166
      protected trackCouponUsage_args getEmptyArgsInstance() {
1167
        return new trackCouponUsage_args();
1982 varun.gupt 1168
      }
1169
 
3430 rajveer 1170
      protected trackCouponUsage_result getResult(I iface, trackCouponUsage_args args) throws org.apache.thrift.TException {
1171
        trackCouponUsage_result result = new trackCouponUsage_result();
1172
        try {
1173
          iface.trackCouponUsage(args.couponCode, args.transactionId, args.userId);
1174
        } catch (PromotionException pex) {
1175
          result.pex = pex;
1176
        }
1177
        return result;
1178
      }
1982 varun.gupt 1179
    }
1180
 
3430 rajveer 1181
    private static class getCouponUsageCountByUser<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getCouponUsageCountByUser_args> {
1182
      public getCouponUsageCountByUser() {
1183
        super("getCouponUsageCountByUser");
1982 varun.gupt 1184
      }
1185
 
3430 rajveer 1186
      protected getCouponUsageCountByUser_args getEmptyArgsInstance() {
1187
        return new getCouponUsageCountByUser_args();
1188
      }
1982 varun.gupt 1189
 
3430 rajveer 1190
      protected getCouponUsageCountByUser_result getResult(I iface, getCouponUsageCountByUser_args args) throws org.apache.thrift.TException {
1191
        getCouponUsageCountByUser_result result = new getCouponUsageCountByUser_result();
1192
        try {
1193
          result.success = iface.getCouponUsageCountByUser(args.couponCode, args.userId);
1194
          result.setSuccessIsSet(true);
1195
        } catch (PromotionException pex) {
1196
          result.pex = pex;
1197
        }
1198
        return result;
1199
      }
1982 varun.gupt 1200
    }
1201
 
3430 rajveer 1202
    private static class getActiveCoupons<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getActiveCoupons_args> {
1203
      public getActiveCoupons() {
1204
        super("getActiveCoupons");
1205
      }
1982 varun.gupt 1206
 
3430 rajveer 1207
      protected getActiveCoupons_args getEmptyArgsInstance() {
1208
        return new getActiveCoupons_args();
1209
      }
1982 varun.gupt 1210
 
3430 rajveer 1211
      protected getActiveCoupons_result getResult(I iface, getActiveCoupons_args args) throws org.apache.thrift.TException {
1212
        getActiveCoupons_result result = new getActiveCoupons_result();
1213
        try {
1214
          result.success = iface.getActiveCoupons();
1215
        } catch (PromotionException pex) {
1216
          result.pex = pex;
1217
        }
1218
        return result;
1219
      }
1982 varun.gupt 1220
    }
1221
 
3430 rajveer 1222
    private static class getSuccessfulPaymentCountForCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getSuccessfulPaymentCountForCoupon_args> {
1223
      public getSuccessfulPaymentCountForCoupon() {
1224
        super("getSuccessfulPaymentCountForCoupon");
1982 varun.gupt 1225
      }
1226
 
3430 rajveer 1227
      protected getSuccessfulPaymentCountForCoupon_args getEmptyArgsInstance() {
1228
        return new getSuccessfulPaymentCountForCoupon_args();
1229
      }
1982 varun.gupt 1230
 
3430 rajveer 1231
      protected getSuccessfulPaymentCountForCoupon_result getResult(I iface, getSuccessfulPaymentCountForCoupon_args args) throws org.apache.thrift.TException {
1232
        getSuccessfulPaymentCountForCoupon_result result = new getSuccessfulPaymentCountForCoupon_result();
1233
        try {
1234
          result.success = iface.getSuccessfulPaymentCountForCoupon(args.couponCode);
1235
          result.setSuccessIsSet(true);
1236
        } catch (PromotionException pex) {
1237
          result.pex = pex;
1982 varun.gupt 1238
        }
3430 rajveer 1239
        return result;
1982 varun.gupt 1240
      }
1241
    }
1242
 
3430 rajveer 1243
    private static class getRuleDocString<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getRuleDocString_args> {
1244
      public getRuleDocString() {
1245
        super("getRuleDocString");
1246
      }
1982 varun.gupt 1247
 
3430 rajveer 1248
      protected getRuleDocString_args getEmptyArgsInstance() {
1249
        return new getRuleDocString_args();
1250
      }
1982 varun.gupt 1251
 
3430 rajveer 1252
      protected getRuleDocString_result getResult(I iface, getRuleDocString_args args) throws org.apache.thrift.TException {
1253
        getRuleDocString_result result = new getRuleDocString_result();
1254
        result.success = iface.getRuleDocString(args.ruleName);
1255
        return result;
1256
      }
1982 varun.gupt 1257
    }
1258
 
4189 varun.gupt 1259
    private static class getItemDiscountMap<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getItemDiscountMap_args> {
1260
      public getItemDiscountMap() {
1261
        super("getItemDiscountMap");
1262
      }
1263
 
1264
      protected getItemDiscountMap_args getEmptyArgsInstance() {
1265
        return new getItemDiscountMap_args();
1266
      }
1267
 
1268
      protected getItemDiscountMap_result getResult(I iface, getItemDiscountMap_args args) throws org.apache.thrift.TException {
1269
        getItemDiscountMap_result result = new getItemDiscountMap_result();
1270
        try {
1271
          result.success = iface.getItemDiscountMap(args.itemIds);
1272
        } catch (PromotionException pex) {
1273
          result.pex = pex;
1274
        }
1275
        return result;
1276
      }
1277
    }
1278
 
4494 varun.gupt 1279
    private static class getDiscountsForEntity<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getDiscountsForEntity_args> {
1280
      public getDiscountsForEntity() {
1281
        super("getDiscountsForEntity");
1282
      }
1283
 
1284
      protected getDiscountsForEntity_args getEmptyArgsInstance() {
1285
        return new getDiscountsForEntity_args();
1286
      }
1287
 
1288
      protected getDiscountsForEntity_result getResult(I iface, getDiscountsForEntity_args args) throws org.apache.thrift.TException {
1289
        getDiscountsForEntity_result result = new getDiscountsForEntity_result();
1290
        result.success = iface.getDiscountsForEntity(args.entityId);
1291
        return result;
1292
      }
1293
    }
1294
 
5469 rajveer 1295
    private static class addVoucher<I extends Iface> extends org.apache.thrift.ProcessFunction<I, addVoucher_args> {
1296
      public addVoucher() {
1297
        super("addVoucher");
1298
      }
1299
 
1300
      protected addVoucher_args getEmptyArgsInstance() {
1301
        return new addVoucher_args();
1302
      }
1303
 
1304
      protected addVoucher_result getResult(I iface, addVoucher_args args) throws org.apache.thrift.TException {
1305
        addVoucher_result result = new addVoucher_result();
1306
        iface.addVoucher(args.voucher);
1307
        return result;
1308
      }
1309
    }
1310
 
1311
    private static class assignVoucher<I extends Iface> extends org.apache.thrift.ProcessFunction<I, assignVoucher_args> {
1312
      public assignVoucher() {
1313
        super("assignVoucher");
1314
      }
1315
 
1316
      protected assignVoucher_args getEmptyArgsInstance() {
1317
        return new assignVoucher_args();
1318
      }
1319
 
1320
      protected assignVoucher_result getResult(I iface, assignVoucher_args args) throws org.apache.thrift.TException {
1321
        assignVoucher_result result = new assignVoucher_result();
1322
        result.success = iface.assignVoucher(args.userId, args.userEmail, args.voucherType, args.amount);
1323
        return result;
1324
      }
1325
    }
1326
 
1327
    private static class markVoucherAsRedeemed<I extends Iface> extends org.apache.thrift.ProcessFunction<I, markVoucherAsRedeemed_args> {
1328
      public markVoucherAsRedeemed() {
1329
        super("markVoucherAsRedeemed");
1330
      }
1331
 
1332
      protected markVoucherAsRedeemed_args getEmptyArgsInstance() {
1333
        return new markVoucherAsRedeemed_args();
1334
      }
1335
 
1336
      protected markVoucherAsRedeemed_result getResult(I iface, markVoucherAsRedeemed_args args) throws org.apache.thrift.TException {
1337
        markVoucherAsRedeemed_result result = new markVoucherAsRedeemed_result();
1338
        result.success = iface.markVoucherAsRedeemed(args.voucherCode, args.redeemedOn);
1339
        result.setSuccessIsSet(true);
1340
        return result;
1341
      }
1342
    }
1343
 
1982 varun.gupt 1344
  }
1345
 
3430 rajveer 1346
  public static class createPromotion_args implements org.apache.thrift.TBase<createPromotion_args, createPromotion_args._Fields>, java.io.Serializable, Cloneable   {
1347
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createPromotion_args");
1982 varun.gupt 1348
 
3430 rajveer 1349
    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);
1350
    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);
1351
    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);
1352
    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 1353
 
3430 rajveer 1354
    private String name; // required
1355
    private String ruleExecutionSrc; // required
1356
    private long startOn; // required
1357
    private long endOn; // required
1982 varun.gupt 1358
 
1359
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 1360
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 1361
      NAME((short)1, "name"),
1362
      RULE_EXECUTION_SRC((short)2, "ruleExecutionSrc"),
1363
      START_ON((short)3, "startOn"),
1364
      END_ON((short)4, "endOn");
1365
 
1366
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
1367
 
1368
      static {
1369
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
1370
          byName.put(field.getFieldName(), field);
1371
        }
1372
      }
1373
 
1374
      /**
1375
       * Find the _Fields constant that matches fieldId, or null if its not found.
1376
       */
1377
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 1378
        switch(fieldId) {
1379
          case 1: // NAME
1380
            return NAME;
1381
          case 2: // RULE_EXECUTION_SRC
1382
            return RULE_EXECUTION_SRC;
1383
          case 3: // START_ON
1384
            return START_ON;
1385
          case 4: // END_ON
1386
            return END_ON;
1387
          default:
1388
            return null;
1389
        }
1982 varun.gupt 1390
      }
1391
 
1392
      /**
1393
       * Find the _Fields constant that matches fieldId, throwing an exception
1394
       * if it is not found.
1395
       */
1396
      public static _Fields findByThriftIdOrThrow(int fieldId) {
1397
        _Fields fields = findByThriftId(fieldId);
1398
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
1399
        return fields;
1400
      }
1401
 
1402
      /**
1403
       * Find the _Fields constant that matches name, or null if its not found.
1404
       */
1405
      public static _Fields findByName(String name) {
1406
        return byName.get(name);
1407
      }
1408
 
1409
      private final short _thriftId;
1410
      private final String _fieldName;
1411
 
1412
      _Fields(short thriftId, String fieldName) {
1413
        _thriftId = thriftId;
1414
        _fieldName = fieldName;
1415
      }
1416
 
1417
      public short getThriftFieldId() {
1418
        return _thriftId;
1419
      }
1420
 
1421
      public String getFieldName() {
1422
        return _fieldName;
1423
      }
1424
    }
1425
 
1426
    // isset id assignments
1427
    private static final int __STARTON_ISSET_ID = 0;
1428
    private static final int __ENDON_ISSET_ID = 1;
1429
    private BitSet __isset_bit_vector = new BitSet(2);
1430
 
3430 rajveer 1431
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 1432
    static {
3430 rajveer 1433
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
1434
      tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, 
1435
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
1436
      tmpMap.put(_Fields.RULE_EXECUTION_SRC, new org.apache.thrift.meta_data.FieldMetaData("ruleExecutionSrc", org.apache.thrift.TFieldRequirementType.DEFAULT, 
1437
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
1438
      tmpMap.put(_Fields.START_ON, new org.apache.thrift.meta_data.FieldMetaData("startOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
1439
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
1440
      tmpMap.put(_Fields.END_ON, new org.apache.thrift.meta_data.FieldMetaData("endOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
1441
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
1442
      metaDataMap = Collections.unmodifiableMap(tmpMap);
1443
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createPromotion_args.class, metaDataMap);
1982 varun.gupt 1444
    }
1445
 
1446
    public createPromotion_args() {
1447
    }
1448
 
1449
    public createPromotion_args(
1450
      String name,
1451
      String ruleExecutionSrc,
1452
      long startOn,
1453
      long endOn)
1454
    {
1455
      this();
1456
      this.name = name;
1457
      this.ruleExecutionSrc = ruleExecutionSrc;
1458
      this.startOn = startOn;
1459
      setStartOnIsSet(true);
1460
      this.endOn = endOn;
1461
      setEndOnIsSet(true);
1462
    }
1463
 
1464
    /**
1465
     * Performs a deep copy on <i>other</i>.
1466
     */
1467
    public createPromotion_args(createPromotion_args other) {
1468
      __isset_bit_vector.clear();
1469
      __isset_bit_vector.or(other.__isset_bit_vector);
1470
      if (other.isSetName()) {
1471
        this.name = other.name;
1472
      }
1473
      if (other.isSetRuleExecutionSrc()) {
1474
        this.ruleExecutionSrc = other.ruleExecutionSrc;
1475
      }
1476
      this.startOn = other.startOn;
1477
      this.endOn = other.endOn;
1478
    }
1479
 
1480
    public createPromotion_args deepCopy() {
1481
      return new createPromotion_args(this);
1482
    }
1483
 
3430 rajveer 1484
    @Override
1485
    public void clear() {
1486
      this.name = null;
1487
      this.ruleExecutionSrc = null;
1488
      setStartOnIsSet(false);
1489
      this.startOn = 0;
1490
      setEndOnIsSet(false);
1491
      this.endOn = 0;
1982 varun.gupt 1492
    }
1493
 
1494
    public String getName() {
1495
      return this.name;
1496
    }
1497
 
3430 rajveer 1498
    public void setName(String name) {
1982 varun.gupt 1499
      this.name = name;
1500
    }
1501
 
1502
    public void unsetName() {
1503
      this.name = null;
1504
    }
1505
 
3430 rajveer 1506
    /** Returns true if field name is set (has been assigned a value) and false otherwise */
1982 varun.gupt 1507
    public boolean isSetName() {
1508
      return this.name != null;
1509
    }
1510
 
1511
    public void setNameIsSet(boolean value) {
1512
      if (!value) {
1513
        this.name = null;
1514
      }
1515
    }
1516
 
1517
    public String getRuleExecutionSrc() {
1518
      return this.ruleExecutionSrc;
1519
    }
1520
 
3430 rajveer 1521
    public void setRuleExecutionSrc(String ruleExecutionSrc) {
1982 varun.gupt 1522
      this.ruleExecutionSrc = ruleExecutionSrc;
1523
    }
1524
 
1525
    public void unsetRuleExecutionSrc() {
1526
      this.ruleExecutionSrc = null;
1527
    }
1528
 
3430 rajveer 1529
    /** Returns true if field ruleExecutionSrc is set (has been assigned a value) and false otherwise */
1982 varun.gupt 1530
    public boolean isSetRuleExecutionSrc() {
1531
      return this.ruleExecutionSrc != null;
1532
    }
1533
 
1534
    public void setRuleExecutionSrcIsSet(boolean value) {
1535
      if (!value) {
1536
        this.ruleExecutionSrc = null;
1537
      }
1538
    }
1539
 
1540
    public long getStartOn() {
1541
      return this.startOn;
1542
    }
1543
 
3430 rajveer 1544
    public void setStartOn(long startOn) {
1982 varun.gupt 1545
      this.startOn = startOn;
1546
      setStartOnIsSet(true);
1547
    }
1548
 
1549
    public void unsetStartOn() {
1550
      __isset_bit_vector.clear(__STARTON_ISSET_ID);
1551
    }
1552
 
3430 rajveer 1553
    /** Returns true if field startOn is set (has been assigned a value) and false otherwise */
1982 varun.gupt 1554
    public boolean isSetStartOn() {
1555
      return __isset_bit_vector.get(__STARTON_ISSET_ID);
1556
    }
1557
 
1558
    public void setStartOnIsSet(boolean value) {
1559
      __isset_bit_vector.set(__STARTON_ISSET_ID, value);
1560
    }
1561
 
1562
    public long getEndOn() {
1563
      return this.endOn;
1564
    }
1565
 
3430 rajveer 1566
    public void setEndOn(long endOn) {
1982 varun.gupt 1567
      this.endOn = endOn;
1568
      setEndOnIsSet(true);
1569
    }
1570
 
1571
    public void unsetEndOn() {
1572
      __isset_bit_vector.clear(__ENDON_ISSET_ID);
1573
    }
1574
 
3430 rajveer 1575
    /** Returns true if field endOn is set (has been assigned a value) and false otherwise */
1982 varun.gupt 1576
    public boolean isSetEndOn() {
1577
      return __isset_bit_vector.get(__ENDON_ISSET_ID);
1578
    }
1579
 
1580
    public void setEndOnIsSet(boolean value) {
1581
      __isset_bit_vector.set(__ENDON_ISSET_ID, value);
1582
    }
1583
 
1584
    public void setFieldValue(_Fields field, Object value) {
1585
      switch (field) {
1586
      case NAME:
1587
        if (value == null) {
1588
          unsetName();
1589
        } else {
1590
          setName((String)value);
1591
        }
1592
        break;
1593
 
1594
      case RULE_EXECUTION_SRC:
1595
        if (value == null) {
1596
          unsetRuleExecutionSrc();
1597
        } else {
1598
          setRuleExecutionSrc((String)value);
1599
        }
1600
        break;
1601
 
1602
      case START_ON:
1603
        if (value == null) {
1604
          unsetStartOn();
1605
        } else {
1606
          setStartOn((Long)value);
1607
        }
1608
        break;
1609
 
1610
      case END_ON:
1611
        if (value == null) {
1612
          unsetEndOn();
1613
        } else {
1614
          setEndOn((Long)value);
1615
        }
1616
        break;
1617
 
1618
      }
1619
    }
1620
 
1621
    public Object getFieldValue(_Fields field) {
1622
      switch (field) {
1623
      case NAME:
1624
        return getName();
1625
 
1626
      case RULE_EXECUTION_SRC:
1627
        return getRuleExecutionSrc();
1628
 
1629
      case START_ON:
3430 rajveer 1630
        return Long.valueOf(getStartOn());
1982 varun.gupt 1631
 
1632
      case END_ON:
3430 rajveer 1633
        return Long.valueOf(getEndOn());
1982 varun.gupt 1634
 
1635
      }
1636
      throw new IllegalStateException();
1637
    }
1638
 
3430 rajveer 1639
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
1640
    public boolean isSet(_Fields field) {
1641
      if (field == null) {
1642
        throw new IllegalArgumentException();
1643
      }
1982 varun.gupt 1644
 
1645
      switch (field) {
1646
      case NAME:
1647
        return isSetName();
1648
      case RULE_EXECUTION_SRC:
1649
        return isSetRuleExecutionSrc();
1650
      case START_ON:
1651
        return isSetStartOn();
1652
      case END_ON:
1653
        return isSetEndOn();
1654
      }
1655
      throw new IllegalStateException();
1656
    }
1657
 
1658
    @Override
1659
    public boolean equals(Object that) {
1660
      if (that == null)
1661
        return false;
1662
      if (that instanceof createPromotion_args)
1663
        return this.equals((createPromotion_args)that);
1664
      return false;
1665
    }
1666
 
1667
    public boolean equals(createPromotion_args that) {
1668
      if (that == null)
1669
        return false;
1670
 
1671
      boolean this_present_name = true && this.isSetName();
1672
      boolean that_present_name = true && that.isSetName();
1673
      if (this_present_name || that_present_name) {
1674
        if (!(this_present_name && that_present_name))
1675
          return false;
1676
        if (!this.name.equals(that.name))
1677
          return false;
1678
      }
1679
 
1680
      boolean this_present_ruleExecutionSrc = true && this.isSetRuleExecutionSrc();
1681
      boolean that_present_ruleExecutionSrc = true && that.isSetRuleExecutionSrc();
1682
      if (this_present_ruleExecutionSrc || that_present_ruleExecutionSrc) {
1683
        if (!(this_present_ruleExecutionSrc && that_present_ruleExecutionSrc))
1684
          return false;
1685
        if (!this.ruleExecutionSrc.equals(that.ruleExecutionSrc))
1686
          return false;
1687
      }
1688
 
1689
      boolean this_present_startOn = true;
1690
      boolean that_present_startOn = true;
1691
      if (this_present_startOn || that_present_startOn) {
1692
        if (!(this_present_startOn && that_present_startOn))
1693
          return false;
1694
        if (this.startOn != that.startOn)
1695
          return false;
1696
      }
1697
 
1698
      boolean this_present_endOn = true;
1699
      boolean that_present_endOn = true;
1700
      if (this_present_endOn || that_present_endOn) {
1701
        if (!(this_present_endOn && that_present_endOn))
1702
          return false;
1703
        if (this.endOn != that.endOn)
1704
          return false;
1705
      }
1706
 
1707
      return true;
1708
    }
1709
 
1710
    @Override
1711
    public int hashCode() {
1712
      return 0;
1713
    }
1714
 
1715
    public int compareTo(createPromotion_args other) {
1716
      if (!getClass().equals(other.getClass())) {
1717
        return getClass().getName().compareTo(other.getClass().getName());
1718
      }
1719
 
1720
      int lastComparison = 0;
1721
      createPromotion_args typedOther = (createPromotion_args)other;
1722
 
3430 rajveer 1723
      lastComparison = Boolean.valueOf(isSetName()).compareTo(typedOther.isSetName());
1982 varun.gupt 1724
      if (lastComparison != 0) {
1725
        return lastComparison;
1726
      }
3430 rajveer 1727
      if (isSetName()) {
1728
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, typedOther.name);
1729
        if (lastComparison != 0) {
1730
          return lastComparison;
1731
        }
1982 varun.gupt 1732
      }
3430 rajveer 1733
      lastComparison = Boolean.valueOf(isSetRuleExecutionSrc()).compareTo(typedOther.isSetRuleExecutionSrc());
1982 varun.gupt 1734
      if (lastComparison != 0) {
1735
        return lastComparison;
1736
      }
3430 rajveer 1737
      if (isSetRuleExecutionSrc()) {
1738
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ruleExecutionSrc, typedOther.ruleExecutionSrc);
1739
        if (lastComparison != 0) {
1740
          return lastComparison;
1741
        }
1982 varun.gupt 1742
      }
3430 rajveer 1743
      lastComparison = Boolean.valueOf(isSetStartOn()).compareTo(typedOther.isSetStartOn());
1982 varun.gupt 1744
      if (lastComparison != 0) {
1745
        return lastComparison;
1746
      }
3430 rajveer 1747
      if (isSetStartOn()) {
1748
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startOn, typedOther.startOn);
1749
        if (lastComparison != 0) {
1750
          return lastComparison;
1751
        }
1982 varun.gupt 1752
      }
3430 rajveer 1753
      lastComparison = Boolean.valueOf(isSetEndOn()).compareTo(typedOther.isSetEndOn());
1982 varun.gupt 1754
      if (lastComparison != 0) {
1755
        return lastComparison;
1756
      }
3430 rajveer 1757
      if (isSetEndOn()) {
1758
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endOn, typedOther.endOn);
1759
        if (lastComparison != 0) {
1760
          return lastComparison;
1761
        }
1982 varun.gupt 1762
      }
1763
      return 0;
1764
    }
1765
 
3430 rajveer 1766
    public _Fields fieldForId(int fieldId) {
1767
      return _Fields.findByThriftId(fieldId);
1768
    }
1769
 
1770
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
1771
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 1772
      iprot.readStructBegin();
1773
      while (true)
1774
      {
1775
        field = iprot.readFieldBegin();
3430 rajveer 1776
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 1777
          break;
1778
        }
3430 rajveer 1779
        switch (field.id) {
1780
          case 1: // NAME
1781
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
1782
              this.name = iprot.readString();
1783
            } else { 
1784
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1785
            }
1786
            break;
1787
          case 2: // RULE_EXECUTION_SRC
1788
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
1789
              this.ruleExecutionSrc = iprot.readString();
1790
            } else { 
1791
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1792
            }
1793
            break;
1794
          case 3: // START_ON
1795
            if (field.type == org.apache.thrift.protocol.TType.I64) {
1796
              this.startOn = iprot.readI64();
1797
              setStartOnIsSet(true);
1798
            } else { 
1799
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1800
            }
1801
            break;
1802
          case 4: // END_ON
1803
            if (field.type == org.apache.thrift.protocol.TType.I64) {
1804
              this.endOn = iprot.readI64();
1805
              setEndOnIsSet(true);
1806
            } else { 
1807
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1808
            }
1809
            break;
1810
          default:
1811
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 1812
        }
3430 rajveer 1813
        iprot.readFieldEnd();
1982 varun.gupt 1814
      }
1815
      iprot.readStructEnd();
1816
      validate();
1817
    }
1818
 
3430 rajveer 1819
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 1820
      validate();
1821
 
1822
      oprot.writeStructBegin(STRUCT_DESC);
1823
      if (this.name != null) {
1824
        oprot.writeFieldBegin(NAME_FIELD_DESC);
1825
        oprot.writeString(this.name);
1826
        oprot.writeFieldEnd();
1827
      }
1828
      if (this.ruleExecutionSrc != null) {
1829
        oprot.writeFieldBegin(RULE_EXECUTION_SRC_FIELD_DESC);
1830
        oprot.writeString(this.ruleExecutionSrc);
1831
        oprot.writeFieldEnd();
1832
      }
1833
      oprot.writeFieldBegin(START_ON_FIELD_DESC);
1834
      oprot.writeI64(this.startOn);
1835
      oprot.writeFieldEnd();
1836
      oprot.writeFieldBegin(END_ON_FIELD_DESC);
1837
      oprot.writeI64(this.endOn);
1838
      oprot.writeFieldEnd();
1839
      oprot.writeFieldStop();
1840
      oprot.writeStructEnd();
1841
    }
1842
 
1843
    @Override
1844
    public String toString() {
1845
      StringBuilder sb = new StringBuilder("createPromotion_args(");
1846
      boolean first = true;
1847
 
1848
      sb.append("name:");
1849
      if (this.name == null) {
1850
        sb.append("null");
1851
      } else {
1852
        sb.append(this.name);
1853
      }
1854
      first = false;
1855
      if (!first) sb.append(", ");
1856
      sb.append("ruleExecutionSrc:");
1857
      if (this.ruleExecutionSrc == null) {
1858
        sb.append("null");
1859
      } else {
1860
        sb.append(this.ruleExecutionSrc);
1861
      }
1862
      first = false;
1863
      if (!first) sb.append(", ");
1864
      sb.append("startOn:");
1865
      sb.append(this.startOn);
1866
      first = false;
1867
      if (!first) sb.append(", ");
1868
      sb.append("endOn:");
1869
      sb.append(this.endOn);
1870
      first = false;
1871
      sb.append(")");
1872
      return sb.toString();
1873
    }
1874
 
3430 rajveer 1875
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 1876
      // check for required fields
1877
    }
1878
 
3430 rajveer 1879
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
1880
      try {
1881
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
1882
      } catch (org.apache.thrift.TException te) {
1883
        throw new java.io.IOException(te);
1884
      }
1885
    }
1886
 
1887
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
1888
      try {
1889
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
1890
        __isset_bit_vector = new BitSet(1);
1891
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
1892
      } catch (org.apache.thrift.TException te) {
1893
        throw new java.io.IOException(te);
1894
      }
1895
    }
1896
 
1982 varun.gupt 1897
  }
1898
 
3430 rajveer 1899
  public static class createPromotion_result implements org.apache.thrift.TBase<createPromotion_result, createPromotion_result._Fields>, java.io.Serializable, Cloneable   {
1900
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createPromotion_result");
1982 varun.gupt 1901
 
3430 rajveer 1902
    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 1903
 
3430 rajveer 1904
    private PromotionException pex; // required
1982 varun.gupt 1905
 
1906
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 1907
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 1908
      PEX((short)1, "pex");
1909
 
1910
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
1911
 
1912
      static {
1913
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
1914
          byName.put(field.getFieldName(), field);
1915
        }
1916
      }
1917
 
1918
      /**
1919
       * Find the _Fields constant that matches fieldId, or null if its not found.
1920
       */
1921
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 1922
        switch(fieldId) {
1923
          case 1: // PEX
1924
            return PEX;
1925
          default:
1926
            return null;
1927
        }
1982 varun.gupt 1928
      }
1929
 
1930
      /**
1931
       * Find the _Fields constant that matches fieldId, throwing an exception
1932
       * if it is not found.
1933
       */
1934
      public static _Fields findByThriftIdOrThrow(int fieldId) {
1935
        _Fields fields = findByThriftId(fieldId);
1936
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
1937
        return fields;
1938
      }
1939
 
1940
      /**
1941
       * Find the _Fields constant that matches name, or null if its not found.
1942
       */
1943
      public static _Fields findByName(String name) {
1944
        return byName.get(name);
1945
      }
1946
 
1947
      private final short _thriftId;
1948
      private final String _fieldName;
1949
 
1950
      _Fields(short thriftId, String fieldName) {
1951
        _thriftId = thriftId;
1952
        _fieldName = fieldName;
1953
      }
1954
 
1955
      public short getThriftFieldId() {
1956
        return _thriftId;
1957
      }
1958
 
1959
      public String getFieldName() {
1960
        return _fieldName;
1961
      }
1962
    }
1963
 
1964
    // isset id assignments
1965
 
3430 rajveer 1966
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 1967
    static {
3430 rajveer 1968
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
1969
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
1970
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
1971
      metaDataMap = Collections.unmodifiableMap(tmpMap);
1972
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createPromotion_result.class, metaDataMap);
1982 varun.gupt 1973
    }
1974
 
1975
    public createPromotion_result() {
1976
    }
1977
 
1978
    public createPromotion_result(
1979
      PromotionException pex)
1980
    {
1981
      this();
1982
      this.pex = pex;
1983
    }
1984
 
1985
    /**
1986
     * Performs a deep copy on <i>other</i>.
1987
     */
1988
    public createPromotion_result(createPromotion_result other) {
1989
      if (other.isSetPex()) {
1990
        this.pex = new PromotionException(other.pex);
1991
      }
1992
    }
1993
 
1994
    public createPromotion_result deepCopy() {
1995
      return new createPromotion_result(this);
1996
    }
1997
 
3430 rajveer 1998
    @Override
1999
    public void clear() {
2000
      this.pex = null;
1982 varun.gupt 2001
    }
2002
 
2003
    public PromotionException getPex() {
2004
      return this.pex;
2005
    }
2006
 
3430 rajveer 2007
    public void setPex(PromotionException pex) {
1982 varun.gupt 2008
      this.pex = pex;
2009
    }
2010
 
2011
    public void unsetPex() {
2012
      this.pex = null;
2013
    }
2014
 
3430 rajveer 2015
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2016
    public boolean isSetPex() {
2017
      return this.pex != null;
2018
    }
2019
 
2020
    public void setPexIsSet(boolean value) {
2021
      if (!value) {
2022
        this.pex = null;
2023
      }
2024
    }
2025
 
2026
    public void setFieldValue(_Fields field, Object value) {
2027
      switch (field) {
2028
      case PEX:
2029
        if (value == null) {
2030
          unsetPex();
2031
        } else {
2032
          setPex((PromotionException)value);
2033
        }
2034
        break;
2035
 
2036
      }
2037
    }
2038
 
2039
    public Object getFieldValue(_Fields field) {
2040
      switch (field) {
2041
      case PEX:
2042
        return getPex();
2043
 
2044
      }
2045
      throw new IllegalStateException();
2046
    }
2047
 
3430 rajveer 2048
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
2049
    public boolean isSet(_Fields field) {
2050
      if (field == null) {
2051
        throw new IllegalArgumentException();
2052
      }
1982 varun.gupt 2053
 
2054
      switch (field) {
2055
      case PEX:
2056
        return isSetPex();
2057
      }
2058
      throw new IllegalStateException();
2059
    }
2060
 
2061
    @Override
2062
    public boolean equals(Object that) {
2063
      if (that == null)
2064
        return false;
2065
      if (that instanceof createPromotion_result)
2066
        return this.equals((createPromotion_result)that);
2067
      return false;
2068
    }
2069
 
2070
    public boolean equals(createPromotion_result that) {
2071
      if (that == null)
2072
        return false;
2073
 
2074
      boolean this_present_pex = true && this.isSetPex();
2075
      boolean that_present_pex = true && that.isSetPex();
2076
      if (this_present_pex || that_present_pex) {
2077
        if (!(this_present_pex && that_present_pex))
2078
          return false;
2079
        if (!this.pex.equals(that.pex))
2080
          return false;
2081
      }
2082
 
2083
      return true;
2084
    }
2085
 
2086
    @Override
2087
    public int hashCode() {
2088
      return 0;
2089
    }
2090
 
2091
    public int compareTo(createPromotion_result other) {
2092
      if (!getClass().equals(other.getClass())) {
2093
        return getClass().getName().compareTo(other.getClass().getName());
2094
      }
2095
 
2096
      int lastComparison = 0;
2097
      createPromotion_result typedOther = (createPromotion_result)other;
2098
 
3430 rajveer 2099
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 2100
      if (lastComparison != 0) {
2101
        return lastComparison;
2102
      }
3430 rajveer 2103
      if (isSetPex()) {
2104
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
2105
        if (lastComparison != 0) {
2106
          return lastComparison;
2107
        }
1982 varun.gupt 2108
      }
2109
      return 0;
2110
    }
2111
 
3430 rajveer 2112
    public _Fields fieldForId(int fieldId) {
2113
      return _Fields.findByThriftId(fieldId);
2114
    }
2115
 
2116
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
2117
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 2118
      iprot.readStructBegin();
2119
      while (true)
2120
      {
2121
        field = iprot.readFieldBegin();
3430 rajveer 2122
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 2123
          break;
2124
        }
3430 rajveer 2125
        switch (field.id) {
2126
          case 1: // PEX
2127
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
2128
              this.pex = new PromotionException();
2129
              this.pex.read(iprot);
2130
            } else { 
2131
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2132
            }
2133
            break;
2134
          default:
2135
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 2136
        }
3430 rajveer 2137
        iprot.readFieldEnd();
1982 varun.gupt 2138
      }
2139
      iprot.readStructEnd();
2140
      validate();
2141
    }
2142
 
3430 rajveer 2143
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 2144
      oprot.writeStructBegin(STRUCT_DESC);
2145
 
2146
      if (this.isSetPex()) {
2147
        oprot.writeFieldBegin(PEX_FIELD_DESC);
2148
        this.pex.write(oprot);
2149
        oprot.writeFieldEnd();
2150
      }
2151
      oprot.writeFieldStop();
2152
      oprot.writeStructEnd();
2153
    }
2154
 
2155
    @Override
2156
    public String toString() {
2157
      StringBuilder sb = new StringBuilder("createPromotion_result(");
2158
      boolean first = true;
2159
 
2160
      sb.append("pex:");
2161
      if (this.pex == null) {
2162
        sb.append("null");
2163
      } else {
2164
        sb.append(this.pex);
2165
      }
2166
      first = false;
2167
      sb.append(")");
2168
      return sb.toString();
2169
    }
2170
 
3430 rajveer 2171
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 2172
      // check for required fields
2173
    }
2174
 
3430 rajveer 2175
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
2176
      try {
2177
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
2178
      } catch (org.apache.thrift.TException te) {
2179
        throw new java.io.IOException(te);
2180
      }
2181
    }
2182
 
2183
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
2184
      try {
2185
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
2186
      } catch (org.apache.thrift.TException te) {
2187
        throw new java.io.IOException(te);
2188
      }
2189
    }
2190
 
1982 varun.gupt 2191
  }
2192
 
3430 rajveer 2193
  public static class getAllPromotions_args implements org.apache.thrift.TBase<getAllPromotions_args, getAllPromotions_args._Fields>, java.io.Serializable, Cloneable   {
2194
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllPromotions_args");
1982 varun.gupt 2195
 
2196
 
2197
 
2198
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 2199
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 2200
;
2201
 
2202
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2203
 
2204
      static {
2205
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2206
          byName.put(field.getFieldName(), field);
2207
        }
2208
      }
2209
 
2210
      /**
2211
       * Find the _Fields constant that matches fieldId, or null if its not found.
2212
       */
2213
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 2214
        switch(fieldId) {
2215
          default:
2216
            return null;
2217
        }
1982 varun.gupt 2218
      }
2219
 
2220
      /**
2221
       * Find the _Fields constant that matches fieldId, throwing an exception
2222
       * if it is not found.
2223
       */
2224
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2225
        _Fields fields = findByThriftId(fieldId);
2226
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2227
        return fields;
2228
      }
2229
 
2230
      /**
2231
       * Find the _Fields constant that matches name, or null if its not found.
2232
       */
2233
      public static _Fields findByName(String name) {
2234
        return byName.get(name);
2235
      }
2236
 
2237
      private final short _thriftId;
2238
      private final String _fieldName;
2239
 
2240
      _Fields(short thriftId, String fieldName) {
2241
        _thriftId = thriftId;
2242
        _fieldName = fieldName;
2243
      }
2244
 
2245
      public short getThriftFieldId() {
2246
        return _thriftId;
2247
      }
2248
 
2249
      public String getFieldName() {
2250
        return _fieldName;
2251
      }
2252
    }
3430 rajveer 2253
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 2254
    static {
3430 rajveer 2255
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
2256
      metaDataMap = Collections.unmodifiableMap(tmpMap);
2257
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllPromotions_args.class, metaDataMap);
1982 varun.gupt 2258
    }
2259
 
2260
    public getAllPromotions_args() {
2261
    }
2262
 
2263
    /**
2264
     * Performs a deep copy on <i>other</i>.
2265
     */
2266
    public getAllPromotions_args(getAllPromotions_args other) {
2267
    }
2268
 
2269
    public getAllPromotions_args deepCopy() {
2270
      return new getAllPromotions_args(this);
2271
    }
2272
 
3430 rajveer 2273
    @Override
2274
    public void clear() {
1982 varun.gupt 2275
    }
2276
 
2277
    public void setFieldValue(_Fields field, Object value) {
2278
      switch (field) {
2279
      }
2280
    }
2281
 
2282
    public Object getFieldValue(_Fields field) {
2283
      switch (field) {
2284
      }
2285
      throw new IllegalStateException();
2286
    }
2287
 
3430 rajveer 2288
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
2289
    public boolean isSet(_Fields field) {
2290
      if (field == null) {
2291
        throw new IllegalArgumentException();
2292
      }
1982 varun.gupt 2293
 
2294
      switch (field) {
2295
      }
2296
      throw new IllegalStateException();
2297
    }
2298
 
2299
    @Override
2300
    public boolean equals(Object that) {
2301
      if (that == null)
2302
        return false;
2303
      if (that instanceof getAllPromotions_args)
2304
        return this.equals((getAllPromotions_args)that);
2305
      return false;
2306
    }
2307
 
2308
    public boolean equals(getAllPromotions_args that) {
2309
      if (that == null)
2310
        return false;
2311
 
2312
      return true;
2313
    }
2314
 
2315
    @Override
2316
    public int hashCode() {
2317
      return 0;
2318
    }
2319
 
2320
    public int compareTo(getAllPromotions_args other) {
2321
      if (!getClass().equals(other.getClass())) {
2322
        return getClass().getName().compareTo(other.getClass().getName());
2323
      }
2324
 
2325
      int lastComparison = 0;
2326
      getAllPromotions_args typedOther = (getAllPromotions_args)other;
2327
 
2328
      return 0;
2329
    }
2330
 
3430 rajveer 2331
    public _Fields fieldForId(int fieldId) {
2332
      return _Fields.findByThriftId(fieldId);
2333
    }
2334
 
2335
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
2336
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 2337
      iprot.readStructBegin();
2338
      while (true)
2339
      {
2340
        field = iprot.readFieldBegin();
3430 rajveer 2341
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 2342
          break;
2343
        }
3430 rajveer 2344
        switch (field.id) {
2345
          default:
2346
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 2347
        }
3430 rajveer 2348
        iprot.readFieldEnd();
1982 varun.gupt 2349
      }
2350
      iprot.readStructEnd();
2351
      validate();
2352
    }
2353
 
3430 rajveer 2354
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 2355
      validate();
2356
 
2357
      oprot.writeStructBegin(STRUCT_DESC);
2358
      oprot.writeFieldStop();
2359
      oprot.writeStructEnd();
2360
    }
2361
 
2362
    @Override
2363
    public String toString() {
2364
      StringBuilder sb = new StringBuilder("getAllPromotions_args(");
2365
      boolean first = true;
2366
 
2367
      sb.append(")");
2368
      return sb.toString();
2369
    }
2370
 
3430 rajveer 2371
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 2372
      // check for required fields
2373
    }
2374
 
3430 rajveer 2375
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
2376
      try {
2377
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
2378
      } catch (org.apache.thrift.TException te) {
2379
        throw new java.io.IOException(te);
2380
      }
2381
    }
2382
 
2383
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
2384
      try {
2385
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
2386
      } catch (org.apache.thrift.TException te) {
2387
        throw new java.io.IOException(te);
2388
      }
2389
    }
2390
 
1982 varun.gupt 2391
  }
2392
 
3430 rajveer 2393
  public static class getAllPromotions_result implements org.apache.thrift.TBase<getAllPromotions_result, getAllPromotions_result._Fields>, java.io.Serializable, Cloneable   {
2394
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllPromotions_result");
1982 varun.gupt 2395
 
3430 rajveer 2396
    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);
2397
    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 2398
 
3430 rajveer 2399
    private List<Promotion> success; // required
2400
    private PromotionException pex; // required
1982 varun.gupt 2401
 
2402
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 2403
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 2404
      SUCCESS((short)0, "success"),
2405
      PEX((short)1, "pex");
2406
 
2407
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2408
 
2409
      static {
2410
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2411
          byName.put(field.getFieldName(), field);
2412
        }
2413
      }
2414
 
2415
      /**
2416
       * Find the _Fields constant that matches fieldId, or null if its not found.
2417
       */
2418
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 2419
        switch(fieldId) {
2420
          case 0: // SUCCESS
2421
            return SUCCESS;
2422
          case 1: // PEX
2423
            return PEX;
2424
          default:
2425
            return null;
2426
        }
1982 varun.gupt 2427
      }
2428
 
2429
      /**
2430
       * Find the _Fields constant that matches fieldId, throwing an exception
2431
       * if it is not found.
2432
       */
2433
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2434
        _Fields fields = findByThriftId(fieldId);
2435
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2436
        return fields;
2437
      }
2438
 
2439
      /**
2440
       * Find the _Fields constant that matches name, or null if its not found.
2441
       */
2442
      public static _Fields findByName(String name) {
2443
        return byName.get(name);
2444
      }
2445
 
2446
      private final short _thriftId;
2447
      private final String _fieldName;
2448
 
2449
      _Fields(short thriftId, String fieldName) {
2450
        _thriftId = thriftId;
2451
        _fieldName = fieldName;
2452
      }
2453
 
2454
      public short getThriftFieldId() {
2455
        return _thriftId;
2456
      }
2457
 
2458
      public String getFieldName() {
2459
        return _fieldName;
2460
      }
2461
    }
2462
 
2463
    // isset id assignments
2464
 
3430 rajveer 2465
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 2466
    static {
3430 rajveer 2467
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
2468
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2469
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
2470
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Promotion.class))));
2471
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2472
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
2473
      metaDataMap = Collections.unmodifiableMap(tmpMap);
2474
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllPromotions_result.class, metaDataMap);
1982 varun.gupt 2475
    }
2476
 
2477
    public getAllPromotions_result() {
2478
    }
2479
 
2480
    public getAllPromotions_result(
2481
      List<Promotion> success,
2482
      PromotionException pex)
2483
    {
2484
      this();
2485
      this.success = success;
2486
      this.pex = pex;
2487
    }
2488
 
2489
    /**
2490
     * Performs a deep copy on <i>other</i>.
2491
     */
2492
    public getAllPromotions_result(getAllPromotions_result other) {
2493
      if (other.isSetSuccess()) {
2494
        List<Promotion> __this__success = new ArrayList<Promotion>();
2495
        for (Promotion other_element : other.success) {
2496
          __this__success.add(new Promotion(other_element));
2497
        }
2498
        this.success = __this__success;
2499
      }
2500
      if (other.isSetPex()) {
2501
        this.pex = new PromotionException(other.pex);
2502
      }
2503
    }
2504
 
2505
    public getAllPromotions_result deepCopy() {
2506
      return new getAllPromotions_result(this);
2507
    }
2508
 
3430 rajveer 2509
    @Override
2510
    public void clear() {
2511
      this.success = null;
2512
      this.pex = null;
1982 varun.gupt 2513
    }
2514
 
2515
    public int getSuccessSize() {
2516
      return (this.success == null) ? 0 : this.success.size();
2517
    }
2518
 
2519
    public java.util.Iterator<Promotion> getSuccessIterator() {
2520
      return (this.success == null) ? null : this.success.iterator();
2521
    }
2522
 
2523
    public void addToSuccess(Promotion elem) {
2524
      if (this.success == null) {
2525
        this.success = new ArrayList<Promotion>();
2526
      }
2527
      this.success.add(elem);
2528
    }
2529
 
2530
    public List<Promotion> getSuccess() {
2531
      return this.success;
2532
    }
2533
 
3430 rajveer 2534
    public void setSuccess(List<Promotion> success) {
1982 varun.gupt 2535
      this.success = success;
2536
    }
2537
 
2538
    public void unsetSuccess() {
2539
      this.success = null;
2540
    }
2541
 
3430 rajveer 2542
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2543
    public boolean isSetSuccess() {
2544
      return this.success != null;
2545
    }
2546
 
2547
    public void setSuccessIsSet(boolean value) {
2548
      if (!value) {
2549
        this.success = null;
2550
      }
2551
    }
2552
 
2553
    public PromotionException getPex() {
2554
      return this.pex;
2555
    }
2556
 
3430 rajveer 2557
    public void setPex(PromotionException pex) {
1982 varun.gupt 2558
      this.pex = pex;
2559
    }
2560
 
2561
    public void unsetPex() {
2562
      this.pex = null;
2563
    }
2564
 
3430 rajveer 2565
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2566
    public boolean isSetPex() {
2567
      return this.pex != null;
2568
    }
2569
 
2570
    public void setPexIsSet(boolean value) {
2571
      if (!value) {
2572
        this.pex = null;
2573
      }
2574
    }
2575
 
2576
    public void setFieldValue(_Fields field, Object value) {
2577
      switch (field) {
2578
      case SUCCESS:
2579
        if (value == null) {
2580
          unsetSuccess();
2581
        } else {
2582
          setSuccess((List<Promotion>)value);
2583
        }
2584
        break;
2585
 
2586
      case PEX:
2587
        if (value == null) {
2588
          unsetPex();
2589
        } else {
2590
          setPex((PromotionException)value);
2591
        }
2592
        break;
2593
 
2594
      }
2595
    }
2596
 
2597
    public Object getFieldValue(_Fields field) {
2598
      switch (field) {
2599
      case SUCCESS:
2600
        return getSuccess();
2601
 
2602
      case PEX:
2603
        return getPex();
2604
 
2605
      }
2606
      throw new IllegalStateException();
2607
    }
2608
 
3430 rajveer 2609
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
2610
    public boolean isSet(_Fields field) {
2611
      if (field == null) {
2612
        throw new IllegalArgumentException();
2613
      }
1982 varun.gupt 2614
 
2615
      switch (field) {
2616
      case SUCCESS:
2617
        return isSetSuccess();
2618
      case PEX:
2619
        return isSetPex();
2620
      }
2621
      throw new IllegalStateException();
2622
    }
2623
 
2624
    @Override
2625
    public boolean equals(Object that) {
2626
      if (that == null)
2627
        return false;
2628
      if (that instanceof getAllPromotions_result)
2629
        return this.equals((getAllPromotions_result)that);
2630
      return false;
2631
    }
2632
 
2633
    public boolean equals(getAllPromotions_result that) {
2634
      if (that == null)
2635
        return false;
2636
 
2637
      boolean this_present_success = true && this.isSetSuccess();
2638
      boolean that_present_success = true && that.isSetSuccess();
2639
      if (this_present_success || that_present_success) {
2640
        if (!(this_present_success && that_present_success))
2641
          return false;
2642
        if (!this.success.equals(that.success))
2643
          return false;
2644
      }
2645
 
2646
      boolean this_present_pex = true && this.isSetPex();
2647
      boolean that_present_pex = true && that.isSetPex();
2648
      if (this_present_pex || that_present_pex) {
2649
        if (!(this_present_pex && that_present_pex))
2650
          return false;
2651
        if (!this.pex.equals(that.pex))
2652
          return false;
2653
      }
2654
 
2655
      return true;
2656
    }
2657
 
2658
    @Override
2659
    public int hashCode() {
2660
      return 0;
2661
    }
2662
 
2663
    public int compareTo(getAllPromotions_result other) {
2664
      if (!getClass().equals(other.getClass())) {
2665
        return getClass().getName().compareTo(other.getClass().getName());
2666
      }
2667
 
2668
      int lastComparison = 0;
2669
      getAllPromotions_result typedOther = (getAllPromotions_result)other;
2670
 
3430 rajveer 2671
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 2672
      if (lastComparison != 0) {
2673
        return lastComparison;
2674
      }
3430 rajveer 2675
      if (isSetSuccess()) {
2676
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
2677
        if (lastComparison != 0) {
2678
          return lastComparison;
2679
        }
1982 varun.gupt 2680
      }
3430 rajveer 2681
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 2682
      if (lastComparison != 0) {
2683
        return lastComparison;
2684
      }
3430 rajveer 2685
      if (isSetPex()) {
2686
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
2687
        if (lastComparison != 0) {
2688
          return lastComparison;
2689
        }
1982 varun.gupt 2690
      }
2691
      return 0;
2692
    }
2693
 
3430 rajveer 2694
    public _Fields fieldForId(int fieldId) {
2695
      return _Fields.findByThriftId(fieldId);
2696
    }
2697
 
2698
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
2699
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 2700
      iprot.readStructBegin();
2701
      while (true)
2702
      {
2703
        field = iprot.readFieldBegin();
3430 rajveer 2704
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 2705
          break;
2706
        }
3430 rajveer 2707
        switch (field.id) {
2708
          case 0: // SUCCESS
2709
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
2710
              {
5327 rajveer 2711
                org.apache.thrift.protocol.TList _list12 = iprot.readListBegin();
2712
                this.success = new ArrayList<Promotion>(_list12.size);
2713
                for (int _i13 = 0; _i13 < _list12.size; ++_i13)
1982 varun.gupt 2714
                {
5327 rajveer 2715
                  Promotion _elem14; // required
2716
                  _elem14 = new Promotion();
2717
                  _elem14.read(iprot);
2718
                  this.success.add(_elem14);
1982 varun.gupt 2719
                }
3430 rajveer 2720
                iprot.readListEnd();
1982 varun.gupt 2721
              }
3430 rajveer 2722
            } else { 
2723
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2724
            }
2725
            break;
2726
          case 1: // PEX
2727
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
2728
              this.pex = new PromotionException();
2729
              this.pex.read(iprot);
2730
            } else { 
2731
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2732
            }
2733
            break;
2734
          default:
2735
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 2736
        }
3430 rajveer 2737
        iprot.readFieldEnd();
1982 varun.gupt 2738
      }
2739
      iprot.readStructEnd();
2740
      validate();
2741
    }
2742
 
3430 rajveer 2743
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 2744
      oprot.writeStructBegin(STRUCT_DESC);
2745
 
2746
      if (this.isSetSuccess()) {
2747
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
2748
        {
3430 rajveer 2749
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
5327 rajveer 2750
          for (Promotion _iter15 : this.success)
1982 varun.gupt 2751
          {
5327 rajveer 2752
            _iter15.write(oprot);
1982 varun.gupt 2753
          }
2754
          oprot.writeListEnd();
2755
        }
2756
        oprot.writeFieldEnd();
2757
      } else if (this.isSetPex()) {
2758
        oprot.writeFieldBegin(PEX_FIELD_DESC);
2759
        this.pex.write(oprot);
2760
        oprot.writeFieldEnd();
2761
      }
2762
      oprot.writeFieldStop();
2763
      oprot.writeStructEnd();
2764
    }
2765
 
2766
    @Override
2767
    public String toString() {
2768
      StringBuilder sb = new StringBuilder("getAllPromotions_result(");
2769
      boolean first = true;
2770
 
2771
      sb.append("success:");
2772
      if (this.success == null) {
2773
        sb.append("null");
2774
      } else {
2775
        sb.append(this.success);
2776
      }
2777
      first = false;
2778
      if (!first) sb.append(", ");
2779
      sb.append("pex:");
2780
      if (this.pex == null) {
2781
        sb.append("null");
2782
      } else {
2783
        sb.append(this.pex);
2784
      }
2785
      first = false;
2786
      sb.append(")");
2787
      return sb.toString();
2788
    }
2789
 
3430 rajveer 2790
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 2791
      // check for required fields
2792
    }
2793
 
3430 rajveer 2794
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
2795
      try {
2796
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
2797
      } catch (org.apache.thrift.TException te) {
2798
        throw new java.io.IOException(te);
2799
      }
2800
    }
2801
 
2802
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
2803
      try {
2804
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
2805
      } catch (org.apache.thrift.TException te) {
2806
        throw new java.io.IOException(te);
2807
      }
2808
    }
2809
 
1982 varun.gupt 2810
  }
2811
 
3430 rajveer 2812
  public static class getPromotionById_args implements org.apache.thrift.TBase<getPromotionById_args, getPromotionById_args._Fields>, java.io.Serializable, Cloneable   {
2813
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPromotionById_args");
1982 varun.gupt 2814
 
3430 rajveer 2815
    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 2816
 
3430 rajveer 2817
    private long promotionId; // required
1982 varun.gupt 2818
 
2819
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 2820
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 2821
      PROMOTION_ID((short)1, "promotionId");
2822
 
2823
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2824
 
2825
      static {
2826
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2827
          byName.put(field.getFieldName(), field);
2828
        }
2829
      }
2830
 
2831
      /**
2832
       * Find the _Fields constant that matches fieldId, or null if its not found.
2833
       */
2834
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 2835
        switch(fieldId) {
2836
          case 1: // PROMOTION_ID
2837
            return PROMOTION_ID;
2838
          default:
2839
            return null;
2840
        }
1982 varun.gupt 2841
      }
2842
 
2843
      /**
2844
       * Find the _Fields constant that matches fieldId, throwing an exception
2845
       * if it is not found.
2846
       */
2847
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2848
        _Fields fields = findByThriftId(fieldId);
2849
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2850
        return fields;
2851
      }
2852
 
2853
      /**
2854
       * Find the _Fields constant that matches name, or null if its not found.
2855
       */
2856
      public static _Fields findByName(String name) {
2857
        return byName.get(name);
2858
      }
2859
 
2860
      private final short _thriftId;
2861
      private final String _fieldName;
2862
 
2863
      _Fields(short thriftId, String fieldName) {
2864
        _thriftId = thriftId;
2865
        _fieldName = fieldName;
2866
      }
2867
 
2868
      public short getThriftFieldId() {
2869
        return _thriftId;
2870
      }
2871
 
2872
      public String getFieldName() {
2873
        return _fieldName;
2874
      }
2875
    }
2876
 
2877
    // isset id assignments
2878
    private static final int __PROMOTIONID_ISSET_ID = 0;
2879
    private BitSet __isset_bit_vector = new BitSet(1);
2880
 
3430 rajveer 2881
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 2882
    static {
3430 rajveer 2883
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
2884
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2885
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
2886
      metaDataMap = Collections.unmodifiableMap(tmpMap);
2887
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPromotionById_args.class, metaDataMap);
1982 varun.gupt 2888
    }
2889
 
2890
    public getPromotionById_args() {
2891
    }
2892
 
2893
    public getPromotionById_args(
2894
      long promotionId)
2895
    {
2896
      this();
2897
      this.promotionId = promotionId;
2898
      setPromotionIdIsSet(true);
2899
    }
2900
 
2901
    /**
2902
     * Performs a deep copy on <i>other</i>.
2903
     */
2904
    public getPromotionById_args(getPromotionById_args other) {
2905
      __isset_bit_vector.clear();
2906
      __isset_bit_vector.or(other.__isset_bit_vector);
2907
      this.promotionId = other.promotionId;
2908
    }
2909
 
2910
    public getPromotionById_args deepCopy() {
2911
      return new getPromotionById_args(this);
2912
    }
2913
 
3430 rajveer 2914
    @Override
2915
    public void clear() {
2916
      setPromotionIdIsSet(false);
2917
      this.promotionId = 0;
1982 varun.gupt 2918
    }
2919
 
2920
    public long getPromotionId() {
2921
      return this.promotionId;
2922
    }
2923
 
3430 rajveer 2924
    public void setPromotionId(long promotionId) {
1982 varun.gupt 2925
      this.promotionId = promotionId;
2926
      setPromotionIdIsSet(true);
2927
    }
2928
 
2929
    public void unsetPromotionId() {
2930
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
2931
    }
2932
 
3430 rajveer 2933
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2934
    public boolean isSetPromotionId() {
2935
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
2936
    }
2937
 
2938
    public void setPromotionIdIsSet(boolean value) {
2939
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
2940
    }
2941
 
2942
    public void setFieldValue(_Fields field, Object value) {
2943
      switch (field) {
2944
      case PROMOTION_ID:
2945
        if (value == null) {
2946
          unsetPromotionId();
2947
        } else {
2948
          setPromotionId((Long)value);
2949
        }
2950
        break;
2951
 
2952
      }
2953
    }
2954
 
2955
    public Object getFieldValue(_Fields field) {
2956
      switch (field) {
2957
      case PROMOTION_ID:
3430 rajveer 2958
        return Long.valueOf(getPromotionId());
1982 varun.gupt 2959
 
2960
      }
2961
      throw new IllegalStateException();
2962
    }
2963
 
3430 rajveer 2964
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
2965
    public boolean isSet(_Fields field) {
2966
      if (field == null) {
2967
        throw new IllegalArgumentException();
2968
      }
1982 varun.gupt 2969
 
2970
      switch (field) {
2971
      case PROMOTION_ID:
2972
        return isSetPromotionId();
2973
      }
2974
      throw new IllegalStateException();
2975
    }
2976
 
2977
    @Override
2978
    public boolean equals(Object that) {
2979
      if (that == null)
2980
        return false;
2981
      if (that instanceof getPromotionById_args)
2982
        return this.equals((getPromotionById_args)that);
2983
      return false;
2984
    }
2985
 
2986
    public boolean equals(getPromotionById_args that) {
2987
      if (that == null)
2988
        return false;
2989
 
2990
      boolean this_present_promotionId = true;
2991
      boolean that_present_promotionId = true;
2992
      if (this_present_promotionId || that_present_promotionId) {
2993
        if (!(this_present_promotionId && that_present_promotionId))
2994
          return false;
2995
        if (this.promotionId != that.promotionId)
2996
          return false;
2997
      }
2998
 
2999
      return true;
3000
    }
3001
 
3002
    @Override
3003
    public int hashCode() {
3004
      return 0;
3005
    }
3006
 
3007
    public int compareTo(getPromotionById_args other) {
3008
      if (!getClass().equals(other.getClass())) {
3009
        return getClass().getName().compareTo(other.getClass().getName());
3010
      }
3011
 
3012
      int lastComparison = 0;
3013
      getPromotionById_args typedOther = (getPromotionById_args)other;
3014
 
3430 rajveer 3015
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
1982 varun.gupt 3016
      if (lastComparison != 0) {
3017
        return lastComparison;
3018
      }
3430 rajveer 3019
      if (isSetPromotionId()) {
3020
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
3021
        if (lastComparison != 0) {
3022
          return lastComparison;
3023
        }
1982 varun.gupt 3024
      }
3025
      return 0;
3026
    }
3027
 
3430 rajveer 3028
    public _Fields fieldForId(int fieldId) {
3029
      return _Fields.findByThriftId(fieldId);
3030
    }
3031
 
3032
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
3033
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 3034
      iprot.readStructBegin();
3035
      while (true)
3036
      {
3037
        field = iprot.readFieldBegin();
3430 rajveer 3038
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 3039
          break;
3040
        }
3430 rajveer 3041
        switch (field.id) {
3042
          case 1: // PROMOTION_ID
3043
            if (field.type == org.apache.thrift.protocol.TType.I64) {
3044
              this.promotionId = iprot.readI64();
3045
              setPromotionIdIsSet(true);
3046
            } else { 
3047
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3048
            }
3049
            break;
3050
          default:
3051
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 3052
        }
3430 rajveer 3053
        iprot.readFieldEnd();
1982 varun.gupt 3054
      }
3055
      iprot.readStructEnd();
3056
      validate();
3057
    }
3058
 
3430 rajveer 3059
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 3060
      validate();
3061
 
3062
      oprot.writeStructBegin(STRUCT_DESC);
3063
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
3064
      oprot.writeI64(this.promotionId);
3065
      oprot.writeFieldEnd();
3066
      oprot.writeFieldStop();
3067
      oprot.writeStructEnd();
3068
    }
3069
 
3070
    @Override
3071
    public String toString() {
3072
      StringBuilder sb = new StringBuilder("getPromotionById_args(");
3073
      boolean first = true;
3074
 
3075
      sb.append("promotionId:");
3076
      sb.append(this.promotionId);
3077
      first = false;
3078
      sb.append(")");
3079
      return sb.toString();
3080
    }
3081
 
3430 rajveer 3082
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 3083
      // check for required fields
3084
    }
3085
 
3430 rajveer 3086
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
3087
      try {
3088
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
3089
      } catch (org.apache.thrift.TException te) {
3090
        throw new java.io.IOException(te);
3091
      }
3092
    }
3093
 
3094
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
3095
      try {
3096
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
3097
        __isset_bit_vector = new BitSet(1);
3098
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
3099
      } catch (org.apache.thrift.TException te) {
3100
        throw new java.io.IOException(te);
3101
      }
3102
    }
3103
 
1982 varun.gupt 3104
  }
3105
 
3430 rajveer 3106
  public static class getPromotionById_result implements org.apache.thrift.TBase<getPromotionById_result, getPromotionById_result._Fields>, java.io.Serializable, Cloneable   {
3107
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPromotionById_result");
1982 varun.gupt 3108
 
3430 rajveer 3109
    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);
3110
    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 3111
 
3430 rajveer 3112
    private Promotion success; // required
3113
    private PromotionException pex; // required
1982 varun.gupt 3114
 
3115
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 3116
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 3117
      SUCCESS((short)0, "success"),
3118
      PEX((short)1, "pex");
3119
 
3120
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3121
 
3122
      static {
3123
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3124
          byName.put(field.getFieldName(), field);
3125
        }
3126
      }
3127
 
3128
      /**
3129
       * Find the _Fields constant that matches fieldId, or null if its not found.
3130
       */
3131
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 3132
        switch(fieldId) {
3133
          case 0: // SUCCESS
3134
            return SUCCESS;
3135
          case 1: // PEX
3136
            return PEX;
3137
          default:
3138
            return null;
3139
        }
1982 varun.gupt 3140
      }
3141
 
3142
      /**
3143
       * Find the _Fields constant that matches fieldId, throwing an exception
3144
       * if it is not found.
3145
       */
3146
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3147
        _Fields fields = findByThriftId(fieldId);
3148
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3149
        return fields;
3150
      }
3151
 
3152
      /**
3153
       * Find the _Fields constant that matches name, or null if its not found.
3154
       */
3155
      public static _Fields findByName(String name) {
3156
        return byName.get(name);
3157
      }
3158
 
3159
      private final short _thriftId;
3160
      private final String _fieldName;
3161
 
3162
      _Fields(short thriftId, String fieldName) {
3163
        _thriftId = thriftId;
3164
        _fieldName = fieldName;
3165
      }
3166
 
3167
      public short getThriftFieldId() {
3168
        return _thriftId;
3169
      }
3170
 
3171
      public String getFieldName() {
3172
        return _fieldName;
3173
      }
3174
    }
3175
 
3176
    // isset id assignments
3177
 
3430 rajveer 3178
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 3179
    static {
3430 rajveer 3180
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
3181
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3182
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Promotion.class)));
3183
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3184
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
3185
      metaDataMap = Collections.unmodifiableMap(tmpMap);
3186
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPromotionById_result.class, metaDataMap);
1982 varun.gupt 3187
    }
3188
 
3189
    public getPromotionById_result() {
3190
    }
3191
 
3192
    public getPromotionById_result(
3193
      Promotion success,
3194
      PromotionException pex)
3195
    {
3196
      this();
3197
      this.success = success;
3198
      this.pex = pex;
3199
    }
3200
 
3201
    /**
3202
     * Performs a deep copy on <i>other</i>.
3203
     */
3204
    public getPromotionById_result(getPromotionById_result other) {
3205
      if (other.isSetSuccess()) {
3206
        this.success = new Promotion(other.success);
3207
      }
3208
      if (other.isSetPex()) {
3209
        this.pex = new PromotionException(other.pex);
3210
      }
3211
    }
3212
 
3213
    public getPromotionById_result deepCopy() {
3214
      return new getPromotionById_result(this);
3215
    }
3216
 
3430 rajveer 3217
    @Override
3218
    public void clear() {
3219
      this.success = null;
3220
      this.pex = null;
1982 varun.gupt 3221
    }
3222
 
3223
    public Promotion getSuccess() {
3224
      return this.success;
3225
    }
3226
 
3430 rajveer 3227
    public void setSuccess(Promotion success) {
1982 varun.gupt 3228
      this.success = success;
3229
    }
3230
 
3231
    public void unsetSuccess() {
3232
      this.success = null;
3233
    }
3234
 
3430 rajveer 3235
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 3236
    public boolean isSetSuccess() {
3237
      return this.success != null;
3238
    }
3239
 
3240
    public void setSuccessIsSet(boolean value) {
3241
      if (!value) {
3242
        this.success = null;
3243
      }
3244
    }
3245
 
3246
    public PromotionException getPex() {
3247
      return this.pex;
3248
    }
3249
 
3430 rajveer 3250
    public void setPex(PromotionException pex) {
1982 varun.gupt 3251
      this.pex = pex;
3252
    }
3253
 
3254
    public void unsetPex() {
3255
      this.pex = null;
3256
    }
3257
 
3430 rajveer 3258
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 3259
    public boolean isSetPex() {
3260
      return this.pex != null;
3261
    }
3262
 
3263
    public void setPexIsSet(boolean value) {
3264
      if (!value) {
3265
        this.pex = null;
3266
      }
3267
    }
3268
 
3269
    public void setFieldValue(_Fields field, Object value) {
3270
      switch (field) {
3271
      case SUCCESS:
3272
        if (value == null) {
3273
          unsetSuccess();
3274
        } else {
3275
          setSuccess((Promotion)value);
3276
        }
3277
        break;
3278
 
3279
      case PEX:
3280
        if (value == null) {
3281
          unsetPex();
3282
        } else {
3283
          setPex((PromotionException)value);
3284
        }
3285
        break;
3286
 
3287
      }
3288
    }
3289
 
3290
    public Object getFieldValue(_Fields field) {
3291
      switch (field) {
3292
      case SUCCESS:
3293
        return getSuccess();
3294
 
3295
      case PEX:
3296
        return getPex();
3297
 
3298
      }
3299
      throw new IllegalStateException();
3300
    }
3301
 
3430 rajveer 3302
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
3303
    public boolean isSet(_Fields field) {
3304
      if (field == null) {
3305
        throw new IllegalArgumentException();
3306
      }
1982 varun.gupt 3307
 
3308
      switch (field) {
3309
      case SUCCESS:
3310
        return isSetSuccess();
3311
      case PEX:
3312
        return isSetPex();
3313
      }
3314
      throw new IllegalStateException();
3315
    }
3316
 
3317
    @Override
3318
    public boolean equals(Object that) {
3319
      if (that == null)
3320
        return false;
3321
      if (that instanceof getPromotionById_result)
3322
        return this.equals((getPromotionById_result)that);
3323
      return false;
3324
    }
3325
 
3326
    public boolean equals(getPromotionById_result that) {
3327
      if (that == null)
3328
        return false;
3329
 
3330
      boolean this_present_success = true && this.isSetSuccess();
3331
      boolean that_present_success = true && that.isSetSuccess();
3332
      if (this_present_success || that_present_success) {
3333
        if (!(this_present_success && that_present_success))
3334
          return false;
3335
        if (!this.success.equals(that.success))
3336
          return false;
3337
      }
3338
 
3339
      boolean this_present_pex = true && this.isSetPex();
3340
      boolean that_present_pex = true && that.isSetPex();
3341
      if (this_present_pex || that_present_pex) {
3342
        if (!(this_present_pex && that_present_pex))
3343
          return false;
3344
        if (!this.pex.equals(that.pex))
3345
          return false;
3346
      }
3347
 
3348
      return true;
3349
    }
3350
 
3351
    @Override
3352
    public int hashCode() {
3353
      return 0;
3354
    }
3355
 
3356
    public int compareTo(getPromotionById_result other) {
3357
      if (!getClass().equals(other.getClass())) {
3358
        return getClass().getName().compareTo(other.getClass().getName());
3359
      }
3360
 
3361
      int lastComparison = 0;
3362
      getPromotionById_result typedOther = (getPromotionById_result)other;
3363
 
3430 rajveer 3364
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 3365
      if (lastComparison != 0) {
3366
        return lastComparison;
3367
      }
3430 rajveer 3368
      if (isSetSuccess()) {
3369
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
3370
        if (lastComparison != 0) {
3371
          return lastComparison;
3372
        }
1982 varun.gupt 3373
      }
3430 rajveer 3374
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 3375
      if (lastComparison != 0) {
3376
        return lastComparison;
3377
      }
3430 rajveer 3378
      if (isSetPex()) {
3379
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
3380
        if (lastComparison != 0) {
3381
          return lastComparison;
3382
        }
1982 varun.gupt 3383
      }
3384
      return 0;
3385
    }
3386
 
3430 rajveer 3387
    public _Fields fieldForId(int fieldId) {
3388
      return _Fields.findByThriftId(fieldId);
3389
    }
3390
 
3391
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
3392
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 3393
      iprot.readStructBegin();
3394
      while (true)
3395
      {
3396
        field = iprot.readFieldBegin();
3430 rajveer 3397
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 3398
          break;
3399
        }
3430 rajveer 3400
        switch (field.id) {
3401
          case 0: // SUCCESS
3402
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
3403
              this.success = new Promotion();
3404
              this.success.read(iprot);
3405
            } else { 
3406
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3407
            }
3408
            break;
3409
          case 1: // PEX
3410
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
3411
              this.pex = new PromotionException();
3412
              this.pex.read(iprot);
3413
            } else { 
3414
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3415
            }
3416
            break;
3417
          default:
3418
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 3419
        }
3430 rajveer 3420
        iprot.readFieldEnd();
1982 varun.gupt 3421
      }
3422
      iprot.readStructEnd();
3423
      validate();
3424
    }
3425
 
3430 rajveer 3426
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 3427
      oprot.writeStructBegin(STRUCT_DESC);
3428
 
3429
      if (this.isSetSuccess()) {
3430
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
3431
        this.success.write(oprot);
3432
        oprot.writeFieldEnd();
3433
      } else if (this.isSetPex()) {
3434
        oprot.writeFieldBegin(PEX_FIELD_DESC);
3435
        this.pex.write(oprot);
3436
        oprot.writeFieldEnd();
3437
      }
3438
      oprot.writeFieldStop();
3439
      oprot.writeStructEnd();
3440
    }
3441
 
3442
    @Override
3443
    public String toString() {
3444
      StringBuilder sb = new StringBuilder("getPromotionById_result(");
3445
      boolean first = true;
3446
 
3447
      sb.append("success:");
3448
      if (this.success == null) {
3449
        sb.append("null");
3450
      } else {
3451
        sb.append(this.success);
3452
      }
3453
      first = false;
3454
      if (!first) sb.append(", ");
3455
      sb.append("pex:");
3456
      if (this.pex == null) {
3457
        sb.append("null");
3458
      } else {
3459
        sb.append(this.pex);
3460
      }
3461
      first = false;
3462
      sb.append(")");
3463
      return sb.toString();
3464
    }
3465
 
3430 rajveer 3466
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 3467
      // check for required fields
3468
    }
3469
 
3430 rajveer 3470
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
3471
      try {
3472
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
3473
      } catch (org.apache.thrift.TException te) {
3474
        throw new java.io.IOException(te);
3475
      }
3476
    }
3477
 
3478
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
3479
      try {
3480
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
3481
      } catch (org.apache.thrift.TException te) {
3482
        throw new java.io.IOException(te);
3483
      }
3484
    }
3485
 
1982 varun.gupt 3486
  }
3487
 
3430 rajveer 3488
  public static class generateCouponsForPromotion_args implements org.apache.thrift.TBase<generateCouponsForPromotion_args, generateCouponsForPromotion_args._Fields>, java.io.Serializable, Cloneable   {
3489
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("generateCouponsForPromotion_args");
1982 varun.gupt 3490
 
3430 rajveer 3491
    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);
3492
    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 3493
 
3430 rajveer 3494
    private long promotionId; // required
3495
    private String couponCode; // required
1982 varun.gupt 3496
 
3497
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 3498
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 3499
      PROMOTION_ID((short)1, "promotionId"),
3500
      COUPON_CODE((short)2, "couponCode");
3501
 
3502
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3503
 
3504
      static {
3505
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3506
          byName.put(field.getFieldName(), field);
3507
        }
3508
      }
3509
 
3510
      /**
3511
       * Find the _Fields constant that matches fieldId, or null if its not found.
3512
       */
3513
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 3514
        switch(fieldId) {
3515
          case 1: // PROMOTION_ID
3516
            return PROMOTION_ID;
3517
          case 2: // COUPON_CODE
3518
            return COUPON_CODE;
3519
          default:
3520
            return null;
3521
        }
1982 varun.gupt 3522
      }
3523
 
3524
      /**
3525
       * Find the _Fields constant that matches fieldId, throwing an exception
3526
       * if it is not found.
3527
       */
3528
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3529
        _Fields fields = findByThriftId(fieldId);
3530
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3531
        return fields;
3532
      }
3533
 
3534
      /**
3535
       * Find the _Fields constant that matches name, or null if its not found.
3536
       */
3537
      public static _Fields findByName(String name) {
3538
        return byName.get(name);
3539
      }
3540
 
3541
      private final short _thriftId;
3542
      private final String _fieldName;
3543
 
3544
      _Fields(short thriftId, String fieldName) {
3545
        _thriftId = thriftId;
3546
        _fieldName = fieldName;
3547
      }
3548
 
3549
      public short getThriftFieldId() {
3550
        return _thriftId;
3551
      }
3552
 
3553
      public String getFieldName() {
3554
        return _fieldName;
3555
      }
3556
    }
3557
 
3558
    // isset id assignments
3559
    private static final int __PROMOTIONID_ISSET_ID = 0;
3560
    private BitSet __isset_bit_vector = new BitSet(1);
3561
 
3430 rajveer 3562
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 3563
    static {
3430 rajveer 3564
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
3565
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3566
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
3567
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3568
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
3569
      metaDataMap = Collections.unmodifiableMap(tmpMap);
3570
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(generateCouponsForPromotion_args.class, metaDataMap);
1982 varun.gupt 3571
    }
3572
 
3573
    public generateCouponsForPromotion_args() {
3574
    }
3575
 
3576
    public generateCouponsForPromotion_args(
3577
      long promotionId,
3578
      String couponCode)
3579
    {
3580
      this();
3581
      this.promotionId = promotionId;
3582
      setPromotionIdIsSet(true);
3583
      this.couponCode = couponCode;
3584
    }
3585
 
3586
    /**
3587
     * Performs a deep copy on <i>other</i>.
3588
     */
3589
    public generateCouponsForPromotion_args(generateCouponsForPromotion_args other) {
3590
      __isset_bit_vector.clear();
3591
      __isset_bit_vector.or(other.__isset_bit_vector);
3592
      this.promotionId = other.promotionId;
3593
      if (other.isSetCouponCode()) {
3594
        this.couponCode = other.couponCode;
3595
      }
3596
    }
3597
 
3598
    public generateCouponsForPromotion_args deepCopy() {
3599
      return new generateCouponsForPromotion_args(this);
3600
    }
3601
 
3430 rajveer 3602
    @Override
3603
    public void clear() {
3604
      setPromotionIdIsSet(false);
3605
      this.promotionId = 0;
3606
      this.couponCode = null;
1982 varun.gupt 3607
    }
3608
 
3609
    public long getPromotionId() {
3610
      return this.promotionId;
3611
    }
3612
 
3430 rajveer 3613
    public void setPromotionId(long promotionId) {
1982 varun.gupt 3614
      this.promotionId = promotionId;
3615
      setPromotionIdIsSet(true);
3616
    }
3617
 
3618
    public void unsetPromotionId() {
3619
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
3620
    }
3621
 
3430 rajveer 3622
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 3623
    public boolean isSetPromotionId() {
3624
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
3625
    }
3626
 
3627
    public void setPromotionIdIsSet(boolean value) {
3628
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
3629
    }
3630
 
3631
    public String getCouponCode() {
3632
      return this.couponCode;
3633
    }
3634
 
3430 rajveer 3635
    public void setCouponCode(String couponCode) {
1982 varun.gupt 3636
      this.couponCode = couponCode;
3637
    }
3638
 
3639
    public void unsetCouponCode() {
3640
      this.couponCode = null;
3641
    }
3642
 
3430 rajveer 3643
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 3644
    public boolean isSetCouponCode() {
3645
      return this.couponCode != null;
3646
    }
3647
 
3648
    public void setCouponCodeIsSet(boolean value) {
3649
      if (!value) {
3650
        this.couponCode = null;
3651
      }
3652
    }
3653
 
3654
    public void setFieldValue(_Fields field, Object value) {
3655
      switch (field) {
3656
      case PROMOTION_ID:
3657
        if (value == null) {
3658
          unsetPromotionId();
3659
        } else {
3660
          setPromotionId((Long)value);
3661
        }
3662
        break;
3663
 
3664
      case COUPON_CODE:
3665
        if (value == null) {
3666
          unsetCouponCode();
3667
        } else {
3668
          setCouponCode((String)value);
3669
        }
3670
        break;
3671
 
3672
      }
3673
    }
3674
 
3675
    public Object getFieldValue(_Fields field) {
3676
      switch (field) {
3677
      case PROMOTION_ID:
3430 rajveer 3678
        return Long.valueOf(getPromotionId());
1982 varun.gupt 3679
 
3680
      case COUPON_CODE:
3681
        return getCouponCode();
3682
 
3683
      }
3684
      throw new IllegalStateException();
3685
    }
3686
 
3430 rajveer 3687
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
3688
    public boolean isSet(_Fields field) {
3689
      if (field == null) {
3690
        throw new IllegalArgumentException();
3691
      }
1982 varun.gupt 3692
 
3693
      switch (field) {
3694
      case PROMOTION_ID:
3695
        return isSetPromotionId();
3696
      case COUPON_CODE:
3697
        return isSetCouponCode();
3698
      }
3699
      throw new IllegalStateException();
3700
    }
3701
 
3702
    @Override
3703
    public boolean equals(Object that) {
3704
      if (that == null)
3705
        return false;
3706
      if (that instanceof generateCouponsForPromotion_args)
3707
        return this.equals((generateCouponsForPromotion_args)that);
3708
      return false;
3709
    }
3710
 
3711
    public boolean equals(generateCouponsForPromotion_args that) {
3712
      if (that == null)
3713
        return false;
3714
 
3715
      boolean this_present_promotionId = true;
3716
      boolean that_present_promotionId = true;
3717
      if (this_present_promotionId || that_present_promotionId) {
3718
        if (!(this_present_promotionId && that_present_promotionId))
3719
          return false;
3720
        if (this.promotionId != that.promotionId)
3721
          return false;
3722
      }
3723
 
3724
      boolean this_present_couponCode = true && this.isSetCouponCode();
3725
      boolean that_present_couponCode = true && that.isSetCouponCode();
3726
      if (this_present_couponCode || that_present_couponCode) {
3727
        if (!(this_present_couponCode && that_present_couponCode))
3728
          return false;
3729
        if (!this.couponCode.equals(that.couponCode))
3730
          return false;
3731
      }
3732
 
3733
      return true;
3734
    }
3735
 
3736
    @Override
3737
    public int hashCode() {
3738
      return 0;
3739
    }
3740
 
3741
    public int compareTo(generateCouponsForPromotion_args other) {
3742
      if (!getClass().equals(other.getClass())) {
3743
        return getClass().getName().compareTo(other.getClass().getName());
3744
      }
3745
 
3746
      int lastComparison = 0;
3747
      generateCouponsForPromotion_args typedOther = (generateCouponsForPromotion_args)other;
3748
 
3430 rajveer 3749
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
1982 varun.gupt 3750
      if (lastComparison != 0) {
3751
        return lastComparison;
3752
      }
3430 rajveer 3753
      if (isSetPromotionId()) {
3754
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
3755
        if (lastComparison != 0) {
3756
          return lastComparison;
3757
        }
1982 varun.gupt 3758
      }
3430 rajveer 3759
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 3760
      if (lastComparison != 0) {
3761
        return lastComparison;
3762
      }
3430 rajveer 3763
      if (isSetCouponCode()) {
3764
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
3765
        if (lastComparison != 0) {
3766
          return lastComparison;
3767
        }
1982 varun.gupt 3768
      }
3769
      return 0;
3770
    }
3771
 
3430 rajveer 3772
    public _Fields fieldForId(int fieldId) {
3773
      return _Fields.findByThriftId(fieldId);
3774
    }
3775
 
3776
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
3777
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 3778
      iprot.readStructBegin();
3779
      while (true)
3780
      {
3781
        field = iprot.readFieldBegin();
3430 rajveer 3782
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 3783
          break;
3784
        }
3430 rajveer 3785
        switch (field.id) {
3786
          case 1: // PROMOTION_ID
3787
            if (field.type == org.apache.thrift.protocol.TType.I64) {
3788
              this.promotionId = iprot.readI64();
3789
              setPromotionIdIsSet(true);
3790
            } else { 
3791
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3792
            }
3793
            break;
3794
          case 2: // COUPON_CODE
3795
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
3796
              this.couponCode = iprot.readString();
3797
            } else { 
3798
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3799
            }
3800
            break;
3801
          default:
3802
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 3803
        }
3430 rajveer 3804
        iprot.readFieldEnd();
1982 varun.gupt 3805
      }
3806
      iprot.readStructEnd();
3807
      validate();
3808
    }
3809
 
3430 rajveer 3810
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 3811
      validate();
3812
 
3813
      oprot.writeStructBegin(STRUCT_DESC);
3814
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
3815
      oprot.writeI64(this.promotionId);
3816
      oprot.writeFieldEnd();
3817
      if (this.couponCode != null) {
3818
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
3819
        oprot.writeString(this.couponCode);
3820
        oprot.writeFieldEnd();
3821
      }
3822
      oprot.writeFieldStop();
3823
      oprot.writeStructEnd();
3824
    }
3825
 
3826
    @Override
3827
    public String toString() {
3828
      StringBuilder sb = new StringBuilder("generateCouponsForPromotion_args(");
3829
      boolean first = true;
3830
 
3831
      sb.append("promotionId:");
3832
      sb.append(this.promotionId);
3833
      first = false;
3834
      if (!first) sb.append(", ");
3835
      sb.append("couponCode:");
3836
      if (this.couponCode == null) {
3837
        sb.append("null");
3838
      } else {
3839
        sb.append(this.couponCode);
3840
      }
3841
      first = false;
3842
      sb.append(")");
3843
      return sb.toString();
3844
    }
3845
 
3430 rajveer 3846
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 3847
      // check for required fields
3848
    }
3849
 
3430 rajveer 3850
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
3851
      try {
3852
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
3853
      } catch (org.apache.thrift.TException te) {
3854
        throw new java.io.IOException(te);
3855
      }
3856
    }
3857
 
3858
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
3859
      try {
3860
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
3861
        __isset_bit_vector = new BitSet(1);
3862
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
3863
      } catch (org.apache.thrift.TException te) {
3864
        throw new java.io.IOException(te);
3865
      }
3866
    }
3867
 
1982 varun.gupt 3868
  }
3869
 
3430 rajveer 3870
  public static class generateCouponsForPromotion_result implements org.apache.thrift.TBase<generateCouponsForPromotion_result, generateCouponsForPromotion_result._Fields>, java.io.Serializable, Cloneable   {
3871
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("generateCouponsForPromotion_result");
1982 varun.gupt 3872
 
3430 rajveer 3873
    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 3874
 
3430 rajveer 3875
    private PromotionException pex; // required
1982 varun.gupt 3876
 
3877
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 3878
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 3879
      PEX((short)1, "pex");
3880
 
3881
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3882
 
3883
      static {
3884
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3885
          byName.put(field.getFieldName(), field);
3886
        }
3887
      }
3888
 
3889
      /**
3890
       * Find the _Fields constant that matches fieldId, or null if its not found.
3891
       */
3892
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 3893
        switch(fieldId) {
3894
          case 1: // PEX
3895
            return PEX;
3896
          default:
3897
            return null;
3898
        }
1982 varun.gupt 3899
      }
3900
 
3901
      /**
3902
       * Find the _Fields constant that matches fieldId, throwing an exception
3903
       * if it is not found.
3904
       */
3905
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3906
        _Fields fields = findByThriftId(fieldId);
3907
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3908
        return fields;
3909
      }
3910
 
3911
      /**
3912
       * Find the _Fields constant that matches name, or null if its not found.
3913
       */
3914
      public static _Fields findByName(String name) {
3915
        return byName.get(name);
3916
      }
3917
 
3918
      private final short _thriftId;
3919
      private final String _fieldName;
3920
 
3921
      _Fields(short thriftId, String fieldName) {
3922
        _thriftId = thriftId;
3923
        _fieldName = fieldName;
3924
      }
3925
 
3926
      public short getThriftFieldId() {
3927
        return _thriftId;
3928
      }
3929
 
3930
      public String getFieldName() {
3931
        return _fieldName;
3932
      }
3933
    }
3934
 
3935
    // isset id assignments
3936
 
3430 rajveer 3937
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 3938
    static {
3430 rajveer 3939
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
3940
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3941
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
3942
      metaDataMap = Collections.unmodifiableMap(tmpMap);
3943
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(generateCouponsForPromotion_result.class, metaDataMap);
1982 varun.gupt 3944
    }
3945
 
3946
    public generateCouponsForPromotion_result() {
3947
    }
3948
 
3949
    public generateCouponsForPromotion_result(
3950
      PromotionException pex)
3951
    {
3952
      this();
3953
      this.pex = pex;
3954
    }
3955
 
3956
    /**
3957
     * Performs a deep copy on <i>other</i>.
3958
     */
3959
    public generateCouponsForPromotion_result(generateCouponsForPromotion_result other) {
3960
      if (other.isSetPex()) {
3961
        this.pex = new PromotionException(other.pex);
3962
      }
3963
    }
3964
 
3965
    public generateCouponsForPromotion_result deepCopy() {
3966
      return new generateCouponsForPromotion_result(this);
3967
    }
3968
 
3430 rajveer 3969
    @Override
3970
    public void clear() {
3971
      this.pex = null;
1982 varun.gupt 3972
    }
3973
 
3974
    public PromotionException getPex() {
3975
      return this.pex;
3976
    }
3977
 
3430 rajveer 3978
    public void setPex(PromotionException pex) {
1982 varun.gupt 3979
      this.pex = pex;
3980
    }
3981
 
3982
    public void unsetPex() {
3983
      this.pex = null;
3984
    }
3985
 
3430 rajveer 3986
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 3987
    public boolean isSetPex() {
3988
      return this.pex != null;
3989
    }
3990
 
3991
    public void setPexIsSet(boolean value) {
3992
      if (!value) {
3993
        this.pex = null;
3994
      }
3995
    }
3996
 
3997
    public void setFieldValue(_Fields field, Object value) {
3998
      switch (field) {
3999
      case PEX:
4000
        if (value == null) {
4001
          unsetPex();
4002
        } else {
4003
          setPex((PromotionException)value);
4004
        }
4005
        break;
4006
 
4007
      }
4008
    }
4009
 
4010
    public Object getFieldValue(_Fields field) {
4011
      switch (field) {
4012
      case PEX:
4013
        return getPex();
4014
 
4015
      }
4016
      throw new IllegalStateException();
4017
    }
4018
 
3430 rajveer 4019
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
4020
    public boolean isSet(_Fields field) {
4021
      if (field == null) {
4022
        throw new IllegalArgumentException();
4023
      }
1982 varun.gupt 4024
 
4025
      switch (field) {
4026
      case PEX:
4027
        return isSetPex();
4028
      }
4029
      throw new IllegalStateException();
4030
    }
4031
 
4032
    @Override
4033
    public boolean equals(Object that) {
4034
      if (that == null)
4035
        return false;
4036
      if (that instanceof generateCouponsForPromotion_result)
4037
        return this.equals((generateCouponsForPromotion_result)that);
4038
      return false;
4039
    }
4040
 
4041
    public boolean equals(generateCouponsForPromotion_result that) {
4042
      if (that == null)
4043
        return false;
4044
 
4045
      boolean this_present_pex = true && this.isSetPex();
4046
      boolean that_present_pex = true && that.isSetPex();
4047
      if (this_present_pex || that_present_pex) {
4048
        if (!(this_present_pex && that_present_pex))
4049
          return false;
4050
        if (!this.pex.equals(that.pex))
4051
          return false;
4052
      }
4053
 
4054
      return true;
4055
    }
4056
 
4057
    @Override
4058
    public int hashCode() {
4059
      return 0;
4060
    }
4061
 
4062
    public int compareTo(generateCouponsForPromotion_result other) {
4063
      if (!getClass().equals(other.getClass())) {
4064
        return getClass().getName().compareTo(other.getClass().getName());
4065
      }
4066
 
4067
      int lastComparison = 0;
4068
      generateCouponsForPromotion_result typedOther = (generateCouponsForPromotion_result)other;
4069
 
3430 rajveer 4070
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 4071
      if (lastComparison != 0) {
4072
        return lastComparison;
4073
      }
3430 rajveer 4074
      if (isSetPex()) {
4075
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
4076
        if (lastComparison != 0) {
4077
          return lastComparison;
4078
        }
1982 varun.gupt 4079
      }
4080
      return 0;
4081
    }
4082
 
3430 rajveer 4083
    public _Fields fieldForId(int fieldId) {
4084
      return _Fields.findByThriftId(fieldId);
4085
    }
4086
 
4087
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4088
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 4089
      iprot.readStructBegin();
4090
      while (true)
4091
      {
4092
        field = iprot.readFieldBegin();
3430 rajveer 4093
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 4094
          break;
4095
        }
3430 rajveer 4096
        switch (field.id) {
4097
          case 1: // PEX
4098
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
4099
              this.pex = new PromotionException();
4100
              this.pex.read(iprot);
4101
            } else { 
4102
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4103
            }
4104
            break;
4105
          default:
4106
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 4107
        }
3430 rajveer 4108
        iprot.readFieldEnd();
1982 varun.gupt 4109
      }
4110
      iprot.readStructEnd();
4111
      validate();
4112
    }
4113
 
3430 rajveer 4114
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 4115
      oprot.writeStructBegin(STRUCT_DESC);
4116
 
4117
      if (this.isSetPex()) {
4118
        oprot.writeFieldBegin(PEX_FIELD_DESC);
4119
        this.pex.write(oprot);
4120
        oprot.writeFieldEnd();
4121
      }
4122
      oprot.writeFieldStop();
4123
      oprot.writeStructEnd();
4124
    }
4125
 
4126
    @Override
4127
    public String toString() {
4128
      StringBuilder sb = new StringBuilder("generateCouponsForPromotion_result(");
4129
      boolean first = true;
4130
 
4131
      sb.append("pex:");
4132
      if (this.pex == null) {
4133
        sb.append("null");
4134
      } else {
4135
        sb.append(this.pex);
4136
      }
4137
      first = false;
4138
      sb.append(")");
4139
      return sb.toString();
4140
    }
4141
 
3430 rajveer 4142
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 4143
      // check for required fields
4144
    }
4145
 
3430 rajveer 4146
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
4147
      try {
4148
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
4149
      } catch (org.apache.thrift.TException te) {
4150
        throw new java.io.IOException(te);
4151
      }
4152
    }
4153
 
4154
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
4155
      try {
4156
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
4157
      } catch (org.apache.thrift.TException te) {
4158
        throw new java.io.IOException(te);
4159
      }
4160
    }
4161
 
1982 varun.gupt 4162
  }
4163
 
3430 rajveer 4164
  public static class applyCoupon_args implements org.apache.thrift.TBase<applyCoupon_args, applyCoupon_args._Fields>, java.io.Serializable, Cloneable   {
4165
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyCoupon_args");
1982 varun.gupt 4166
 
3430 rajveer 4167
    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);
4168
    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 4169
 
3430 rajveer 4170
    private String couponCode; // required
4171
    private long cartId; // required
1982 varun.gupt 4172
 
4173
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 4174
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 4175
      COUPON_CODE((short)1, "couponCode"),
4176
      CART_ID((short)2, "cartId");
4177
 
4178
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4179
 
4180
      static {
4181
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4182
          byName.put(field.getFieldName(), field);
4183
        }
4184
      }
4185
 
4186
      /**
4187
       * Find the _Fields constant that matches fieldId, or null if its not found.
4188
       */
4189
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 4190
        switch(fieldId) {
4191
          case 1: // COUPON_CODE
4192
            return COUPON_CODE;
4193
          case 2: // CART_ID
4194
            return CART_ID;
4195
          default:
4196
            return null;
4197
        }
1982 varun.gupt 4198
      }
4199
 
4200
      /**
4201
       * Find the _Fields constant that matches fieldId, throwing an exception
4202
       * if it is not found.
4203
       */
4204
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4205
        _Fields fields = findByThriftId(fieldId);
4206
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4207
        return fields;
4208
      }
4209
 
4210
      /**
4211
       * Find the _Fields constant that matches name, or null if its not found.
4212
       */
4213
      public static _Fields findByName(String name) {
4214
        return byName.get(name);
4215
      }
4216
 
4217
      private final short _thriftId;
4218
      private final String _fieldName;
4219
 
4220
      _Fields(short thriftId, String fieldName) {
4221
        _thriftId = thriftId;
4222
        _fieldName = fieldName;
4223
      }
4224
 
4225
      public short getThriftFieldId() {
4226
        return _thriftId;
4227
      }
4228
 
4229
      public String getFieldName() {
4230
        return _fieldName;
4231
      }
4232
    }
4233
 
4234
    // isset id assignments
4235
    private static final int __CARTID_ISSET_ID = 0;
4236
    private BitSet __isset_bit_vector = new BitSet(1);
4237
 
3430 rajveer 4238
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 4239
    static {
3430 rajveer 4240
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
4241
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4242
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
4243
      tmpMap.put(_Fields.CART_ID, new org.apache.thrift.meta_data.FieldMetaData("cartId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4244
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
4245
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4246
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyCoupon_args.class, metaDataMap);
1982 varun.gupt 4247
    }
4248
 
4249
    public applyCoupon_args() {
4250
    }
4251
 
4252
    public applyCoupon_args(
4253
      String couponCode,
4254
      long cartId)
4255
    {
4256
      this();
4257
      this.couponCode = couponCode;
4258
      this.cartId = cartId;
4259
      setCartIdIsSet(true);
4260
    }
4261
 
4262
    /**
4263
     * Performs a deep copy on <i>other</i>.
4264
     */
4265
    public applyCoupon_args(applyCoupon_args other) {
4266
      __isset_bit_vector.clear();
4267
      __isset_bit_vector.or(other.__isset_bit_vector);
4268
      if (other.isSetCouponCode()) {
4269
        this.couponCode = other.couponCode;
4270
      }
4271
      this.cartId = other.cartId;
4272
    }
4273
 
4274
    public applyCoupon_args deepCopy() {
4275
      return new applyCoupon_args(this);
4276
    }
4277
 
3430 rajveer 4278
    @Override
4279
    public void clear() {
4280
      this.couponCode = null;
4281
      setCartIdIsSet(false);
4282
      this.cartId = 0;
1982 varun.gupt 4283
    }
4284
 
4285
    public String getCouponCode() {
4286
      return this.couponCode;
4287
    }
4288
 
3430 rajveer 4289
    public void setCouponCode(String couponCode) {
1982 varun.gupt 4290
      this.couponCode = couponCode;
4291
    }
4292
 
4293
    public void unsetCouponCode() {
4294
      this.couponCode = null;
4295
    }
4296
 
3430 rajveer 4297
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 4298
    public boolean isSetCouponCode() {
4299
      return this.couponCode != null;
4300
    }
4301
 
4302
    public void setCouponCodeIsSet(boolean value) {
4303
      if (!value) {
4304
        this.couponCode = null;
4305
      }
4306
    }
4307
 
4308
    public long getCartId() {
4309
      return this.cartId;
4310
    }
4311
 
3430 rajveer 4312
    public void setCartId(long cartId) {
1982 varun.gupt 4313
      this.cartId = cartId;
4314
      setCartIdIsSet(true);
4315
    }
4316
 
4317
    public void unsetCartId() {
4318
      __isset_bit_vector.clear(__CARTID_ISSET_ID);
4319
    }
4320
 
3430 rajveer 4321
    /** Returns true if field cartId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 4322
    public boolean isSetCartId() {
4323
      return __isset_bit_vector.get(__CARTID_ISSET_ID);
4324
    }
4325
 
4326
    public void setCartIdIsSet(boolean value) {
4327
      __isset_bit_vector.set(__CARTID_ISSET_ID, value);
4328
    }
4329
 
4330
    public void setFieldValue(_Fields field, Object value) {
4331
      switch (field) {
4332
      case COUPON_CODE:
4333
        if (value == null) {
4334
          unsetCouponCode();
4335
        } else {
4336
          setCouponCode((String)value);
4337
        }
4338
        break;
4339
 
4340
      case CART_ID:
4341
        if (value == null) {
4342
          unsetCartId();
4343
        } else {
4344
          setCartId((Long)value);
4345
        }
4346
        break;
4347
 
4348
      }
4349
    }
4350
 
4351
    public Object getFieldValue(_Fields field) {
4352
      switch (field) {
4353
      case COUPON_CODE:
4354
        return getCouponCode();
4355
 
4356
      case CART_ID:
3430 rajveer 4357
        return Long.valueOf(getCartId());
1982 varun.gupt 4358
 
4359
      }
4360
      throw new IllegalStateException();
4361
    }
4362
 
3430 rajveer 4363
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
4364
    public boolean isSet(_Fields field) {
4365
      if (field == null) {
4366
        throw new IllegalArgumentException();
4367
      }
1982 varun.gupt 4368
 
4369
      switch (field) {
4370
      case COUPON_CODE:
4371
        return isSetCouponCode();
4372
      case CART_ID:
4373
        return isSetCartId();
4374
      }
4375
      throw new IllegalStateException();
4376
    }
4377
 
4378
    @Override
4379
    public boolean equals(Object that) {
4380
      if (that == null)
4381
        return false;
4382
      if (that instanceof applyCoupon_args)
4383
        return this.equals((applyCoupon_args)that);
4384
      return false;
4385
    }
4386
 
4387
    public boolean equals(applyCoupon_args that) {
4388
      if (that == null)
4389
        return false;
4390
 
4391
      boolean this_present_couponCode = true && this.isSetCouponCode();
4392
      boolean that_present_couponCode = true && that.isSetCouponCode();
4393
      if (this_present_couponCode || that_present_couponCode) {
4394
        if (!(this_present_couponCode && that_present_couponCode))
4395
          return false;
4396
        if (!this.couponCode.equals(that.couponCode))
4397
          return false;
4398
      }
4399
 
4400
      boolean this_present_cartId = true;
4401
      boolean that_present_cartId = true;
4402
      if (this_present_cartId || that_present_cartId) {
4403
        if (!(this_present_cartId && that_present_cartId))
4404
          return false;
4405
        if (this.cartId != that.cartId)
4406
          return false;
4407
      }
4408
 
4409
      return true;
4410
    }
4411
 
4412
    @Override
4413
    public int hashCode() {
4414
      return 0;
4415
    }
4416
 
4417
    public int compareTo(applyCoupon_args other) {
4418
      if (!getClass().equals(other.getClass())) {
4419
        return getClass().getName().compareTo(other.getClass().getName());
4420
      }
4421
 
4422
      int lastComparison = 0;
4423
      applyCoupon_args typedOther = (applyCoupon_args)other;
4424
 
3430 rajveer 4425
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 4426
      if (lastComparison != 0) {
4427
        return lastComparison;
4428
      }
3430 rajveer 4429
      if (isSetCouponCode()) {
4430
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
4431
        if (lastComparison != 0) {
4432
          return lastComparison;
4433
        }
1982 varun.gupt 4434
      }
3430 rajveer 4435
      lastComparison = Boolean.valueOf(isSetCartId()).compareTo(typedOther.isSetCartId());
1982 varun.gupt 4436
      if (lastComparison != 0) {
4437
        return lastComparison;
4438
      }
3430 rajveer 4439
      if (isSetCartId()) {
4440
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cartId, typedOther.cartId);
4441
        if (lastComparison != 0) {
4442
          return lastComparison;
4443
        }
1982 varun.gupt 4444
      }
4445
      return 0;
4446
    }
4447
 
3430 rajveer 4448
    public _Fields fieldForId(int fieldId) {
4449
      return _Fields.findByThriftId(fieldId);
4450
    }
4451
 
4452
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4453
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 4454
      iprot.readStructBegin();
4455
      while (true)
4456
      {
4457
        field = iprot.readFieldBegin();
3430 rajveer 4458
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 4459
          break;
4460
        }
3430 rajveer 4461
        switch (field.id) {
4462
          case 1: // COUPON_CODE
4463
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
4464
              this.couponCode = iprot.readString();
4465
            } else { 
4466
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4467
            }
4468
            break;
4469
          case 2: // CART_ID
4470
            if (field.type == org.apache.thrift.protocol.TType.I64) {
4471
              this.cartId = iprot.readI64();
4472
              setCartIdIsSet(true);
4473
            } else { 
4474
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4475
            }
4476
            break;
4477
          default:
4478
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 4479
        }
3430 rajveer 4480
        iprot.readFieldEnd();
1982 varun.gupt 4481
      }
4482
      iprot.readStructEnd();
4483
      validate();
4484
    }
4485
 
3430 rajveer 4486
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 4487
      validate();
4488
 
4489
      oprot.writeStructBegin(STRUCT_DESC);
4490
      if (this.couponCode != null) {
4491
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
4492
        oprot.writeString(this.couponCode);
4493
        oprot.writeFieldEnd();
4494
      }
4495
      oprot.writeFieldBegin(CART_ID_FIELD_DESC);
4496
      oprot.writeI64(this.cartId);
4497
      oprot.writeFieldEnd();
4498
      oprot.writeFieldStop();
4499
      oprot.writeStructEnd();
4500
    }
4501
 
4502
    @Override
4503
    public String toString() {
4504
      StringBuilder sb = new StringBuilder("applyCoupon_args(");
4505
      boolean first = true;
4506
 
4507
      sb.append("couponCode:");
4508
      if (this.couponCode == null) {
4509
        sb.append("null");
4510
      } else {
4511
        sb.append(this.couponCode);
4512
      }
4513
      first = false;
4514
      if (!first) sb.append(", ");
4515
      sb.append("cartId:");
4516
      sb.append(this.cartId);
4517
      first = false;
4518
      sb.append(")");
4519
      return sb.toString();
4520
    }
4521
 
3430 rajveer 4522
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 4523
      // check for required fields
4524
    }
4525
 
3430 rajveer 4526
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
4527
      try {
4528
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
4529
      } catch (org.apache.thrift.TException te) {
4530
        throw new java.io.IOException(te);
4531
      }
4532
    }
4533
 
4534
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
4535
      try {
4536
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
4537
        __isset_bit_vector = new BitSet(1);
4538
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
4539
      } catch (org.apache.thrift.TException te) {
4540
        throw new java.io.IOException(te);
4541
      }
4542
    }
4543
 
1982 varun.gupt 4544
  }
4545
 
3430 rajveer 4546
  public static class applyCoupon_result implements org.apache.thrift.TBase<applyCoupon_result, applyCoupon_result._Fields>, java.io.Serializable, Cloneable   {
4547
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyCoupon_result");
1982 varun.gupt 4548
 
3430 rajveer 4549
    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);
4550
    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 4551
 
3430 rajveer 4552
    private Cart success; // required
4553
    private PromotionException pex; // required
1982 varun.gupt 4554
 
4555
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 4556
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 4557
      SUCCESS((short)0, "success"),
4558
      PEX((short)1, "pex");
4559
 
4560
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4561
 
4562
      static {
4563
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4564
          byName.put(field.getFieldName(), field);
4565
        }
4566
      }
4567
 
4568
      /**
4569
       * Find the _Fields constant that matches fieldId, or null if its not found.
4570
       */
4571
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 4572
        switch(fieldId) {
4573
          case 0: // SUCCESS
4574
            return SUCCESS;
4575
          case 1: // PEX
4576
            return PEX;
4577
          default:
4578
            return null;
4579
        }
1982 varun.gupt 4580
      }
4581
 
4582
      /**
4583
       * Find the _Fields constant that matches fieldId, throwing an exception
4584
       * if it is not found.
4585
       */
4586
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4587
        _Fields fields = findByThriftId(fieldId);
4588
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4589
        return fields;
4590
      }
4591
 
4592
      /**
4593
       * Find the _Fields constant that matches name, or null if its not found.
4594
       */
4595
      public static _Fields findByName(String name) {
4596
        return byName.get(name);
4597
      }
4598
 
4599
      private final short _thriftId;
4600
      private final String _fieldName;
4601
 
4602
      _Fields(short thriftId, String fieldName) {
4603
        _thriftId = thriftId;
4604
        _fieldName = fieldName;
4605
      }
4606
 
4607
      public short getThriftFieldId() {
4608
        return _thriftId;
4609
      }
4610
 
4611
      public String getFieldName() {
4612
        return _fieldName;
4613
      }
4614
    }
4615
 
4616
    // isset id assignments
4617
 
3430 rajveer 4618
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 4619
    static {
3430 rajveer 4620
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
4621
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4622
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Cart.class)));
4623
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4624
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
4625
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4626
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyCoupon_result.class, metaDataMap);
1982 varun.gupt 4627
    }
4628
 
4629
    public applyCoupon_result() {
4630
    }
4631
 
4632
    public applyCoupon_result(
4633
      Cart success,
4634
      PromotionException pex)
4635
    {
4636
      this();
4637
      this.success = success;
4638
      this.pex = pex;
4639
    }
4640
 
4641
    /**
4642
     * Performs a deep copy on <i>other</i>.
4643
     */
4644
    public applyCoupon_result(applyCoupon_result other) {
4645
      if (other.isSetSuccess()) {
4646
        this.success = new Cart(other.success);
4647
      }
4648
      if (other.isSetPex()) {
4649
        this.pex = new PromotionException(other.pex);
4650
      }
4651
    }
4652
 
4653
    public applyCoupon_result deepCopy() {
4654
      return new applyCoupon_result(this);
4655
    }
4656
 
3430 rajveer 4657
    @Override
4658
    public void clear() {
4659
      this.success = null;
4660
      this.pex = null;
1982 varun.gupt 4661
    }
4662
 
4663
    public Cart getSuccess() {
4664
      return this.success;
4665
    }
4666
 
3430 rajveer 4667
    public void setSuccess(Cart success) {
1982 varun.gupt 4668
      this.success = success;
4669
    }
4670
 
4671
    public void unsetSuccess() {
4672
      this.success = null;
4673
    }
4674
 
3430 rajveer 4675
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 4676
    public boolean isSetSuccess() {
4677
      return this.success != null;
4678
    }
4679
 
4680
    public void setSuccessIsSet(boolean value) {
4681
      if (!value) {
4682
        this.success = null;
4683
      }
4684
    }
4685
 
4686
    public PromotionException getPex() {
4687
      return this.pex;
4688
    }
4689
 
3430 rajveer 4690
    public void setPex(PromotionException pex) {
1982 varun.gupt 4691
      this.pex = pex;
4692
    }
4693
 
4694
    public void unsetPex() {
4695
      this.pex = null;
4696
    }
4697
 
3430 rajveer 4698
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 4699
    public boolean isSetPex() {
4700
      return this.pex != null;
4701
    }
4702
 
4703
    public void setPexIsSet(boolean value) {
4704
      if (!value) {
4705
        this.pex = null;
4706
      }
4707
    }
4708
 
4709
    public void setFieldValue(_Fields field, Object value) {
4710
      switch (field) {
4711
      case SUCCESS:
4712
        if (value == null) {
4713
          unsetSuccess();
4714
        } else {
4715
          setSuccess((Cart)value);
4716
        }
4717
        break;
4718
 
4719
      case PEX:
4720
        if (value == null) {
4721
          unsetPex();
4722
        } else {
4723
          setPex((PromotionException)value);
4724
        }
4725
        break;
4726
 
4727
      }
4728
    }
4729
 
4730
    public Object getFieldValue(_Fields field) {
4731
      switch (field) {
4732
      case SUCCESS:
4733
        return getSuccess();
4734
 
4735
      case PEX:
4736
        return getPex();
4737
 
4738
      }
4739
      throw new IllegalStateException();
4740
    }
4741
 
3430 rajveer 4742
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
4743
    public boolean isSet(_Fields field) {
4744
      if (field == null) {
4745
        throw new IllegalArgumentException();
4746
      }
1982 varun.gupt 4747
 
4748
      switch (field) {
4749
      case SUCCESS:
4750
        return isSetSuccess();
4751
      case PEX:
4752
        return isSetPex();
4753
      }
4754
      throw new IllegalStateException();
4755
    }
4756
 
4757
    @Override
4758
    public boolean equals(Object that) {
4759
      if (that == null)
4760
        return false;
4761
      if (that instanceof applyCoupon_result)
4762
        return this.equals((applyCoupon_result)that);
4763
      return false;
4764
    }
4765
 
4766
    public boolean equals(applyCoupon_result that) {
4767
      if (that == null)
4768
        return false;
4769
 
4770
      boolean this_present_success = true && this.isSetSuccess();
4771
      boolean that_present_success = true && that.isSetSuccess();
4772
      if (this_present_success || that_present_success) {
4773
        if (!(this_present_success && that_present_success))
4774
          return false;
4775
        if (!this.success.equals(that.success))
4776
          return false;
4777
      }
4778
 
4779
      boolean this_present_pex = true && this.isSetPex();
4780
      boolean that_present_pex = true && that.isSetPex();
4781
      if (this_present_pex || that_present_pex) {
4782
        if (!(this_present_pex && that_present_pex))
4783
          return false;
4784
        if (!this.pex.equals(that.pex))
4785
          return false;
4786
      }
4787
 
4788
      return true;
4789
    }
4790
 
4791
    @Override
4792
    public int hashCode() {
4793
      return 0;
4794
    }
4795
 
4796
    public int compareTo(applyCoupon_result other) {
4797
      if (!getClass().equals(other.getClass())) {
4798
        return getClass().getName().compareTo(other.getClass().getName());
4799
      }
4800
 
4801
      int lastComparison = 0;
4802
      applyCoupon_result typedOther = (applyCoupon_result)other;
4803
 
3430 rajveer 4804
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 4805
      if (lastComparison != 0) {
4806
        return lastComparison;
4807
      }
3430 rajveer 4808
      if (isSetSuccess()) {
4809
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
4810
        if (lastComparison != 0) {
4811
          return lastComparison;
4812
        }
1982 varun.gupt 4813
      }
3430 rajveer 4814
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 4815
      if (lastComparison != 0) {
4816
        return lastComparison;
4817
      }
3430 rajveer 4818
      if (isSetPex()) {
4819
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
4820
        if (lastComparison != 0) {
4821
          return lastComparison;
4822
        }
1982 varun.gupt 4823
      }
4824
      return 0;
4825
    }
4826
 
3430 rajveer 4827
    public _Fields fieldForId(int fieldId) {
4828
      return _Fields.findByThriftId(fieldId);
4829
    }
4830
 
4831
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4832
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 4833
      iprot.readStructBegin();
4834
      while (true)
4835
      {
4836
        field = iprot.readFieldBegin();
3430 rajveer 4837
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 4838
          break;
4839
        }
3430 rajveer 4840
        switch (field.id) {
4841
          case 0: // SUCCESS
4842
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
4843
              this.success = new Cart();
4844
              this.success.read(iprot);
4845
            } else { 
4846
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4847
            }
4848
            break;
4849
          case 1: // PEX
4850
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
4851
              this.pex = new PromotionException();
4852
              this.pex.read(iprot);
4853
            } else { 
4854
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4855
            }
4856
            break;
4857
          default:
4858
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 4859
        }
3430 rajveer 4860
        iprot.readFieldEnd();
1982 varun.gupt 4861
      }
4862
      iprot.readStructEnd();
4863
      validate();
4864
    }
4865
 
3430 rajveer 4866
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 4867
      oprot.writeStructBegin(STRUCT_DESC);
4868
 
4869
      if (this.isSetSuccess()) {
4870
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
4871
        this.success.write(oprot);
4872
        oprot.writeFieldEnd();
4873
      } else if (this.isSetPex()) {
4874
        oprot.writeFieldBegin(PEX_FIELD_DESC);
4875
        this.pex.write(oprot);
4876
        oprot.writeFieldEnd();
4877
      }
4878
      oprot.writeFieldStop();
4879
      oprot.writeStructEnd();
4880
    }
4881
 
4882
    @Override
4883
    public String toString() {
4884
      StringBuilder sb = new StringBuilder("applyCoupon_result(");
4885
      boolean first = true;
4886
 
4887
      sb.append("success:");
4888
      if (this.success == null) {
4889
        sb.append("null");
4890
      } else {
4891
        sb.append(this.success);
4892
      }
4893
      first = false;
4894
      if (!first) sb.append(", ");
4895
      sb.append("pex:");
4896
      if (this.pex == null) {
4897
        sb.append("null");
4898
      } else {
4899
        sb.append(this.pex);
4900
      }
4901
      first = false;
4902
      sb.append(")");
4903
      return sb.toString();
4904
    }
4905
 
3430 rajveer 4906
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 4907
      // check for required fields
4908
    }
4909
 
3430 rajveer 4910
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
4911
      try {
4912
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
4913
      } catch (org.apache.thrift.TException te) {
4914
        throw new java.io.IOException(te);
4915
      }
4916
    }
4917
 
4918
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
4919
      try {
4920
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
4921
      } catch (org.apache.thrift.TException te) {
4922
        throw new java.io.IOException(te);
4923
      }
4924
    }
4925
 
1982 varun.gupt 4926
  }
4927
 
3430 rajveer 4928
  public static class trackCouponUsage_args implements org.apache.thrift.TBase<trackCouponUsage_args, trackCouponUsage_args._Fields>, java.io.Serializable, Cloneable   {
4929
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("trackCouponUsage_args");
1982 varun.gupt 4930
 
3430 rajveer 4931
    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);
4932
    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);
4933
    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 4934
 
3430 rajveer 4935
    private String couponCode; // required
4936
    private long transactionId; // required
4937
    private long userId; // required
1982 varun.gupt 4938
 
4939
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 4940
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 4941
      COUPON_CODE((short)1, "couponCode"),
4942
      TRANSACTION_ID((short)2, "transactionId"),
4943
      USER_ID((short)3, "userId");
4944
 
4945
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4946
 
4947
      static {
4948
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4949
          byName.put(field.getFieldName(), field);
4950
        }
4951
      }
4952
 
4953
      /**
4954
       * Find the _Fields constant that matches fieldId, or null if its not found.
4955
       */
4956
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 4957
        switch(fieldId) {
4958
          case 1: // COUPON_CODE
4959
            return COUPON_CODE;
4960
          case 2: // TRANSACTION_ID
4961
            return TRANSACTION_ID;
4962
          case 3: // USER_ID
4963
            return USER_ID;
4964
          default:
4965
            return null;
4966
        }
1982 varun.gupt 4967
      }
4968
 
4969
      /**
4970
       * Find the _Fields constant that matches fieldId, throwing an exception
4971
       * if it is not found.
4972
       */
4973
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4974
        _Fields fields = findByThriftId(fieldId);
4975
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4976
        return fields;
4977
      }
4978
 
4979
      /**
4980
       * Find the _Fields constant that matches name, or null if its not found.
4981
       */
4982
      public static _Fields findByName(String name) {
4983
        return byName.get(name);
4984
      }
4985
 
4986
      private final short _thriftId;
4987
      private final String _fieldName;
4988
 
4989
      _Fields(short thriftId, String fieldName) {
4990
        _thriftId = thriftId;
4991
        _fieldName = fieldName;
4992
      }
4993
 
4994
      public short getThriftFieldId() {
4995
        return _thriftId;
4996
      }
4997
 
4998
      public String getFieldName() {
4999
        return _fieldName;
5000
      }
5001
    }
5002
 
5003
    // isset id assignments
5004
    private static final int __TRANSACTIONID_ISSET_ID = 0;
5005
    private static final int __USERID_ISSET_ID = 1;
5006
    private BitSet __isset_bit_vector = new BitSet(2);
5007
 
3430 rajveer 5008
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 5009
    static {
3430 rajveer 5010
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
5011
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5012
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
5013
      tmpMap.put(_Fields.TRANSACTION_ID, new org.apache.thrift.meta_data.FieldMetaData("transactionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5014
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
5015
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5016
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
5017
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5018
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(trackCouponUsage_args.class, metaDataMap);
1982 varun.gupt 5019
    }
5020
 
5021
    public trackCouponUsage_args() {
5022
    }
5023
 
5024
    public trackCouponUsage_args(
5025
      String couponCode,
5026
      long transactionId,
5027
      long userId)
5028
    {
5029
      this();
5030
      this.couponCode = couponCode;
5031
      this.transactionId = transactionId;
5032
      setTransactionIdIsSet(true);
5033
      this.userId = userId;
5034
      setUserIdIsSet(true);
5035
    }
5036
 
5037
    /**
5038
     * Performs a deep copy on <i>other</i>.
5039
     */
5040
    public trackCouponUsage_args(trackCouponUsage_args other) {
5041
      __isset_bit_vector.clear();
5042
      __isset_bit_vector.or(other.__isset_bit_vector);
5043
      if (other.isSetCouponCode()) {
5044
        this.couponCode = other.couponCode;
5045
      }
5046
      this.transactionId = other.transactionId;
5047
      this.userId = other.userId;
5048
    }
5049
 
5050
    public trackCouponUsage_args deepCopy() {
5051
      return new trackCouponUsage_args(this);
5052
    }
5053
 
3430 rajveer 5054
    @Override
5055
    public void clear() {
5056
      this.couponCode = null;
5057
      setTransactionIdIsSet(false);
5058
      this.transactionId = 0;
5059
      setUserIdIsSet(false);
5060
      this.userId = 0;
1982 varun.gupt 5061
    }
5062
 
5063
    public String getCouponCode() {
5064
      return this.couponCode;
5065
    }
5066
 
3430 rajveer 5067
    public void setCouponCode(String couponCode) {
1982 varun.gupt 5068
      this.couponCode = couponCode;
5069
    }
5070
 
5071
    public void unsetCouponCode() {
5072
      this.couponCode = null;
5073
    }
5074
 
3430 rajveer 5075
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 5076
    public boolean isSetCouponCode() {
5077
      return this.couponCode != null;
5078
    }
5079
 
5080
    public void setCouponCodeIsSet(boolean value) {
5081
      if (!value) {
5082
        this.couponCode = null;
5083
      }
5084
    }
5085
 
5086
    public long getTransactionId() {
5087
      return this.transactionId;
5088
    }
5089
 
3430 rajveer 5090
    public void setTransactionId(long transactionId) {
1982 varun.gupt 5091
      this.transactionId = transactionId;
5092
      setTransactionIdIsSet(true);
5093
    }
5094
 
5095
    public void unsetTransactionId() {
5096
      __isset_bit_vector.clear(__TRANSACTIONID_ISSET_ID);
5097
    }
5098
 
3430 rajveer 5099
    /** Returns true if field transactionId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 5100
    public boolean isSetTransactionId() {
5101
      return __isset_bit_vector.get(__TRANSACTIONID_ISSET_ID);
5102
    }
5103
 
5104
    public void setTransactionIdIsSet(boolean value) {
5105
      __isset_bit_vector.set(__TRANSACTIONID_ISSET_ID, value);
5106
    }
5107
 
5108
    public long getUserId() {
5109
      return this.userId;
5110
    }
5111
 
3430 rajveer 5112
    public void setUserId(long userId) {
1982 varun.gupt 5113
      this.userId = userId;
5114
      setUserIdIsSet(true);
5115
    }
5116
 
5117
    public void unsetUserId() {
5118
      __isset_bit_vector.clear(__USERID_ISSET_ID);
5119
    }
5120
 
3430 rajveer 5121
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 5122
    public boolean isSetUserId() {
5123
      return __isset_bit_vector.get(__USERID_ISSET_ID);
5124
    }
5125
 
5126
    public void setUserIdIsSet(boolean value) {
5127
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
5128
    }
5129
 
5130
    public void setFieldValue(_Fields field, Object value) {
5131
      switch (field) {
5132
      case COUPON_CODE:
5133
        if (value == null) {
5134
          unsetCouponCode();
5135
        } else {
5136
          setCouponCode((String)value);
5137
        }
5138
        break;
5139
 
5140
      case TRANSACTION_ID:
5141
        if (value == null) {
5142
          unsetTransactionId();
5143
        } else {
5144
          setTransactionId((Long)value);
5145
        }
5146
        break;
5147
 
5148
      case USER_ID:
5149
        if (value == null) {
5150
          unsetUserId();
5151
        } else {
5152
          setUserId((Long)value);
5153
        }
5154
        break;
5155
 
5156
      }
5157
    }
5158
 
5159
    public Object getFieldValue(_Fields field) {
5160
      switch (field) {
5161
      case COUPON_CODE:
5162
        return getCouponCode();
5163
 
5164
      case TRANSACTION_ID:
3430 rajveer 5165
        return Long.valueOf(getTransactionId());
1982 varun.gupt 5166
 
5167
      case USER_ID:
3430 rajveer 5168
        return Long.valueOf(getUserId());
1982 varun.gupt 5169
 
5170
      }
5171
      throw new IllegalStateException();
5172
    }
5173
 
3430 rajveer 5174
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
5175
    public boolean isSet(_Fields field) {
5176
      if (field == null) {
5177
        throw new IllegalArgumentException();
5178
      }
1982 varun.gupt 5179
 
5180
      switch (field) {
5181
      case COUPON_CODE:
5182
        return isSetCouponCode();
5183
      case TRANSACTION_ID:
5184
        return isSetTransactionId();
5185
      case USER_ID:
5186
        return isSetUserId();
5187
      }
5188
      throw new IllegalStateException();
5189
    }
5190
 
5191
    @Override
5192
    public boolean equals(Object that) {
5193
      if (that == null)
5194
        return false;
5195
      if (that instanceof trackCouponUsage_args)
5196
        return this.equals((trackCouponUsage_args)that);
5197
      return false;
5198
    }
5199
 
5200
    public boolean equals(trackCouponUsage_args that) {
5201
      if (that == null)
5202
        return false;
5203
 
5204
      boolean this_present_couponCode = true && this.isSetCouponCode();
5205
      boolean that_present_couponCode = true && that.isSetCouponCode();
5206
      if (this_present_couponCode || that_present_couponCode) {
5207
        if (!(this_present_couponCode && that_present_couponCode))
5208
          return false;
5209
        if (!this.couponCode.equals(that.couponCode))
5210
          return false;
5211
      }
5212
 
5213
      boolean this_present_transactionId = true;
5214
      boolean that_present_transactionId = true;
5215
      if (this_present_transactionId || that_present_transactionId) {
5216
        if (!(this_present_transactionId && that_present_transactionId))
5217
          return false;
5218
        if (this.transactionId != that.transactionId)
5219
          return false;
5220
      }
5221
 
5222
      boolean this_present_userId = true;
5223
      boolean that_present_userId = true;
5224
      if (this_present_userId || that_present_userId) {
5225
        if (!(this_present_userId && that_present_userId))
5226
          return false;
5227
        if (this.userId != that.userId)
5228
          return false;
5229
      }
5230
 
5231
      return true;
5232
    }
5233
 
5234
    @Override
5235
    public int hashCode() {
5236
      return 0;
5237
    }
5238
 
5239
    public int compareTo(trackCouponUsage_args other) {
5240
      if (!getClass().equals(other.getClass())) {
5241
        return getClass().getName().compareTo(other.getClass().getName());
5242
      }
5243
 
5244
      int lastComparison = 0;
5245
      trackCouponUsage_args typedOther = (trackCouponUsage_args)other;
5246
 
3430 rajveer 5247
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 5248
      if (lastComparison != 0) {
5249
        return lastComparison;
5250
      }
3430 rajveer 5251
      if (isSetCouponCode()) {
5252
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
5253
        if (lastComparison != 0) {
5254
          return lastComparison;
5255
        }
1982 varun.gupt 5256
      }
3430 rajveer 5257
      lastComparison = Boolean.valueOf(isSetTransactionId()).compareTo(typedOther.isSetTransactionId());
1982 varun.gupt 5258
      if (lastComparison != 0) {
5259
        return lastComparison;
5260
      }
3430 rajveer 5261
      if (isSetTransactionId()) {
5262
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.transactionId, typedOther.transactionId);
5263
        if (lastComparison != 0) {
5264
          return lastComparison;
5265
        }
1982 varun.gupt 5266
      }
3430 rajveer 5267
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
1982 varun.gupt 5268
      if (lastComparison != 0) {
5269
        return lastComparison;
5270
      }
3430 rajveer 5271
      if (isSetUserId()) {
5272
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
5273
        if (lastComparison != 0) {
5274
          return lastComparison;
5275
        }
1982 varun.gupt 5276
      }
5277
      return 0;
5278
    }
5279
 
3430 rajveer 5280
    public _Fields fieldForId(int fieldId) {
5281
      return _Fields.findByThriftId(fieldId);
5282
    }
5283
 
5284
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
5285
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 5286
      iprot.readStructBegin();
5287
      while (true)
5288
      {
5289
        field = iprot.readFieldBegin();
3430 rajveer 5290
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 5291
          break;
5292
        }
3430 rajveer 5293
        switch (field.id) {
5294
          case 1: // COUPON_CODE
5295
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
5296
              this.couponCode = iprot.readString();
5297
            } else { 
5298
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5299
            }
5300
            break;
5301
          case 2: // TRANSACTION_ID
5302
            if (field.type == org.apache.thrift.protocol.TType.I64) {
5303
              this.transactionId = iprot.readI64();
5304
              setTransactionIdIsSet(true);
5305
            } else { 
5306
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5307
            }
5308
            break;
5309
          case 3: // USER_ID
5310
            if (field.type == org.apache.thrift.protocol.TType.I64) {
5311
              this.userId = iprot.readI64();
5312
              setUserIdIsSet(true);
5313
            } else { 
5314
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5315
            }
5316
            break;
5317
          default:
5318
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 5319
        }
3430 rajveer 5320
        iprot.readFieldEnd();
1982 varun.gupt 5321
      }
5322
      iprot.readStructEnd();
5323
      validate();
5324
    }
5325
 
3430 rajveer 5326
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 5327
      validate();
5328
 
5329
      oprot.writeStructBegin(STRUCT_DESC);
5330
      if (this.couponCode != null) {
5331
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
5332
        oprot.writeString(this.couponCode);
5333
        oprot.writeFieldEnd();
5334
      }
5335
      oprot.writeFieldBegin(TRANSACTION_ID_FIELD_DESC);
5336
      oprot.writeI64(this.transactionId);
5337
      oprot.writeFieldEnd();
5338
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
5339
      oprot.writeI64(this.userId);
5340
      oprot.writeFieldEnd();
5341
      oprot.writeFieldStop();
5342
      oprot.writeStructEnd();
5343
    }
5344
 
5345
    @Override
5346
    public String toString() {
5347
      StringBuilder sb = new StringBuilder("trackCouponUsage_args(");
5348
      boolean first = true;
5349
 
5350
      sb.append("couponCode:");
5351
      if (this.couponCode == null) {
5352
        sb.append("null");
5353
      } else {
5354
        sb.append(this.couponCode);
5355
      }
5356
      first = false;
5357
      if (!first) sb.append(", ");
5358
      sb.append("transactionId:");
5359
      sb.append(this.transactionId);
5360
      first = false;
5361
      if (!first) sb.append(", ");
5362
      sb.append("userId:");
5363
      sb.append(this.userId);
5364
      first = false;
5365
      sb.append(")");
5366
      return sb.toString();
5367
    }
5368
 
3430 rajveer 5369
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 5370
      // check for required fields
5371
    }
5372
 
3430 rajveer 5373
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5374
      try {
5375
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5376
      } catch (org.apache.thrift.TException te) {
5377
        throw new java.io.IOException(te);
5378
      }
5379
    }
5380
 
5381
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5382
      try {
5383
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
5384
        __isset_bit_vector = new BitSet(1);
5385
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5386
      } catch (org.apache.thrift.TException te) {
5387
        throw new java.io.IOException(te);
5388
      }
5389
    }
5390
 
1982 varun.gupt 5391
  }
5392
 
3430 rajveer 5393
  public static class trackCouponUsage_result implements org.apache.thrift.TBase<trackCouponUsage_result, trackCouponUsage_result._Fields>, java.io.Serializable, Cloneable   {
5394
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("trackCouponUsage_result");
1982 varun.gupt 5395
 
3430 rajveer 5396
    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 5397
 
3430 rajveer 5398
    private PromotionException pex; // required
1982 varun.gupt 5399
 
5400
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 5401
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 5402
      PEX((short)1, "pex");
5403
 
5404
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5405
 
5406
      static {
5407
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5408
          byName.put(field.getFieldName(), field);
5409
        }
5410
      }
5411
 
5412
      /**
5413
       * Find the _Fields constant that matches fieldId, or null if its not found.
5414
       */
5415
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 5416
        switch(fieldId) {
5417
          case 1: // PEX
5418
            return PEX;
5419
          default:
5420
            return null;
5421
        }
1982 varun.gupt 5422
      }
5423
 
5424
      /**
5425
       * Find the _Fields constant that matches fieldId, throwing an exception
5426
       * if it is not found.
5427
       */
5428
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5429
        _Fields fields = findByThriftId(fieldId);
5430
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5431
        return fields;
5432
      }
5433
 
5434
      /**
5435
       * Find the _Fields constant that matches name, or null if its not found.
5436
       */
5437
      public static _Fields findByName(String name) {
5438
        return byName.get(name);
5439
      }
5440
 
5441
      private final short _thriftId;
5442
      private final String _fieldName;
5443
 
5444
      _Fields(short thriftId, String fieldName) {
5445
        _thriftId = thriftId;
5446
        _fieldName = fieldName;
5447
      }
5448
 
5449
      public short getThriftFieldId() {
5450
        return _thriftId;
5451
      }
5452
 
5453
      public String getFieldName() {
5454
        return _fieldName;
5455
      }
5456
    }
5457
 
5458
    // isset id assignments
5459
 
3430 rajveer 5460
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 5461
    static {
3430 rajveer 5462
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
5463
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5464
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
5465
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5466
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(trackCouponUsage_result.class, metaDataMap);
1982 varun.gupt 5467
    }
5468
 
5469
    public trackCouponUsage_result() {
5470
    }
5471
 
5472
    public trackCouponUsage_result(
5473
      PromotionException pex)
5474
    {
5475
      this();
5476
      this.pex = pex;
5477
    }
5478
 
5479
    /**
5480
     * Performs a deep copy on <i>other</i>.
5481
     */
5482
    public trackCouponUsage_result(trackCouponUsage_result other) {
5483
      if (other.isSetPex()) {
5484
        this.pex = new PromotionException(other.pex);
5485
      }
5486
    }
5487
 
5488
    public trackCouponUsage_result deepCopy() {
5489
      return new trackCouponUsage_result(this);
5490
    }
5491
 
3430 rajveer 5492
    @Override
5493
    public void clear() {
5494
      this.pex = null;
1982 varun.gupt 5495
    }
5496
 
5497
    public PromotionException getPex() {
5498
      return this.pex;
5499
    }
5500
 
3430 rajveer 5501
    public void setPex(PromotionException pex) {
1982 varun.gupt 5502
      this.pex = pex;
5503
    }
5504
 
5505
    public void unsetPex() {
5506
      this.pex = null;
5507
    }
5508
 
3430 rajveer 5509
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 5510
    public boolean isSetPex() {
5511
      return this.pex != null;
5512
    }
5513
 
5514
    public void setPexIsSet(boolean value) {
5515
      if (!value) {
5516
        this.pex = null;
5517
      }
5518
    }
5519
 
5520
    public void setFieldValue(_Fields field, Object value) {
5521
      switch (field) {
5522
      case PEX:
5523
        if (value == null) {
5524
          unsetPex();
5525
        } else {
5526
          setPex((PromotionException)value);
5527
        }
5528
        break;
5529
 
5530
      }
5531
    }
5532
 
5533
    public Object getFieldValue(_Fields field) {
5534
      switch (field) {
5535
      case PEX:
5536
        return getPex();
5537
 
5538
      }
5539
      throw new IllegalStateException();
5540
    }
5541
 
3430 rajveer 5542
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
5543
    public boolean isSet(_Fields field) {
5544
      if (field == null) {
5545
        throw new IllegalArgumentException();
5546
      }
1982 varun.gupt 5547
 
5548
      switch (field) {
5549
      case PEX:
5550
        return isSetPex();
5551
      }
5552
      throw new IllegalStateException();
5553
    }
5554
 
5555
    @Override
5556
    public boolean equals(Object that) {
5557
      if (that == null)
5558
        return false;
5559
      if (that instanceof trackCouponUsage_result)
5560
        return this.equals((trackCouponUsage_result)that);
5561
      return false;
5562
    }
5563
 
5564
    public boolean equals(trackCouponUsage_result that) {
5565
      if (that == null)
5566
        return false;
5567
 
5568
      boolean this_present_pex = true && this.isSetPex();
5569
      boolean that_present_pex = true && that.isSetPex();
5570
      if (this_present_pex || that_present_pex) {
5571
        if (!(this_present_pex && that_present_pex))
5572
          return false;
5573
        if (!this.pex.equals(that.pex))
5574
          return false;
5575
      }
5576
 
5577
      return true;
5578
    }
5579
 
5580
    @Override
5581
    public int hashCode() {
5582
      return 0;
5583
    }
5584
 
5585
    public int compareTo(trackCouponUsage_result other) {
5586
      if (!getClass().equals(other.getClass())) {
5587
        return getClass().getName().compareTo(other.getClass().getName());
5588
      }
5589
 
5590
      int lastComparison = 0;
5591
      trackCouponUsage_result typedOther = (trackCouponUsage_result)other;
5592
 
3430 rajveer 5593
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 5594
      if (lastComparison != 0) {
5595
        return lastComparison;
5596
      }
3430 rajveer 5597
      if (isSetPex()) {
5598
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
5599
        if (lastComparison != 0) {
5600
          return lastComparison;
5601
        }
1982 varun.gupt 5602
      }
5603
      return 0;
5604
    }
5605
 
3430 rajveer 5606
    public _Fields fieldForId(int fieldId) {
5607
      return _Fields.findByThriftId(fieldId);
5608
    }
5609
 
5610
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
5611
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 5612
      iprot.readStructBegin();
5613
      while (true)
5614
      {
5615
        field = iprot.readFieldBegin();
3430 rajveer 5616
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 5617
          break;
5618
        }
3430 rajveer 5619
        switch (field.id) {
5620
          case 1: // PEX
5621
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
5622
              this.pex = new PromotionException();
5623
              this.pex.read(iprot);
5624
            } else { 
5625
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5626
            }
5627
            break;
5628
          default:
5629
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 5630
        }
3430 rajveer 5631
        iprot.readFieldEnd();
1982 varun.gupt 5632
      }
5633
      iprot.readStructEnd();
5634
      validate();
5635
    }
5636
 
3430 rajveer 5637
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 5638
      oprot.writeStructBegin(STRUCT_DESC);
5639
 
5640
      if (this.isSetPex()) {
5641
        oprot.writeFieldBegin(PEX_FIELD_DESC);
5642
        this.pex.write(oprot);
5643
        oprot.writeFieldEnd();
5644
      }
5645
      oprot.writeFieldStop();
5646
      oprot.writeStructEnd();
5647
    }
5648
 
5649
    @Override
5650
    public String toString() {
5651
      StringBuilder sb = new StringBuilder("trackCouponUsage_result(");
5652
      boolean first = true;
5653
 
5654
      sb.append("pex:");
5655
      if (this.pex == null) {
5656
        sb.append("null");
5657
      } else {
5658
        sb.append(this.pex);
5659
      }
5660
      first = false;
5661
      sb.append(")");
5662
      return sb.toString();
5663
    }
5664
 
3430 rajveer 5665
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 5666
      // check for required fields
5667
    }
5668
 
3430 rajveer 5669
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5670
      try {
5671
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5672
      } catch (org.apache.thrift.TException te) {
5673
        throw new java.io.IOException(te);
5674
      }
5675
    }
5676
 
5677
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5678
      try {
5679
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5680
      } catch (org.apache.thrift.TException te) {
5681
        throw new java.io.IOException(te);
5682
      }
5683
    }
5684
 
1982 varun.gupt 5685
  }
5686
 
3430 rajveer 5687
  public static class getCouponUsageCountByUser_args implements org.apache.thrift.TBase<getCouponUsageCountByUser_args, getCouponUsageCountByUser_args._Fields>, java.io.Serializable, Cloneable   {
5688
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCouponUsageCountByUser_args");
1982 varun.gupt 5689
 
3430 rajveer 5690
    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);
5691
    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 5692
 
3430 rajveer 5693
    private String couponCode; // required
5694
    private long userId; // required
1982 varun.gupt 5695
 
5696
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 5697
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 5698
      COUPON_CODE((short)1, "couponCode"),
5699
      USER_ID((short)2, "userId");
5700
 
5701
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5702
 
5703
      static {
5704
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5705
          byName.put(field.getFieldName(), field);
5706
        }
5707
      }
5708
 
5709
      /**
5710
       * Find the _Fields constant that matches fieldId, or null if its not found.
5711
       */
5712
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 5713
        switch(fieldId) {
5714
          case 1: // COUPON_CODE
5715
            return COUPON_CODE;
5716
          case 2: // USER_ID
5717
            return USER_ID;
5718
          default:
5719
            return null;
5720
        }
1982 varun.gupt 5721
      }
5722
 
5723
      /**
5724
       * Find the _Fields constant that matches fieldId, throwing an exception
5725
       * if it is not found.
5726
       */
5727
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5728
        _Fields fields = findByThriftId(fieldId);
5729
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5730
        return fields;
5731
      }
5732
 
5733
      /**
5734
       * Find the _Fields constant that matches name, or null if its not found.
5735
       */
5736
      public static _Fields findByName(String name) {
5737
        return byName.get(name);
5738
      }
5739
 
5740
      private final short _thriftId;
5741
      private final String _fieldName;
5742
 
5743
      _Fields(short thriftId, String fieldName) {
5744
        _thriftId = thriftId;
5745
        _fieldName = fieldName;
5746
      }
5747
 
5748
      public short getThriftFieldId() {
5749
        return _thriftId;
5750
      }
5751
 
5752
      public String getFieldName() {
5753
        return _fieldName;
5754
      }
5755
    }
5756
 
5757
    // isset id assignments
5758
    private static final int __USERID_ISSET_ID = 0;
5759
    private BitSet __isset_bit_vector = new BitSet(1);
5760
 
3430 rajveer 5761
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 5762
    static {
3430 rajveer 5763
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
5764
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5765
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
5766
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5767
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
5768
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5769
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCouponUsageCountByUser_args.class, metaDataMap);
1982 varun.gupt 5770
    }
5771
 
5772
    public getCouponUsageCountByUser_args() {
5773
    }
5774
 
5775
    public getCouponUsageCountByUser_args(
5776
      String couponCode,
5777
      long userId)
5778
    {
5779
      this();
5780
      this.couponCode = couponCode;
5781
      this.userId = userId;
5782
      setUserIdIsSet(true);
5783
    }
5784
 
5785
    /**
5786
     * Performs a deep copy on <i>other</i>.
5787
     */
5788
    public getCouponUsageCountByUser_args(getCouponUsageCountByUser_args other) {
5789
      __isset_bit_vector.clear();
5790
      __isset_bit_vector.or(other.__isset_bit_vector);
5791
      if (other.isSetCouponCode()) {
5792
        this.couponCode = other.couponCode;
5793
      }
5794
      this.userId = other.userId;
5795
    }
5796
 
5797
    public getCouponUsageCountByUser_args deepCopy() {
5798
      return new getCouponUsageCountByUser_args(this);
5799
    }
5800
 
3430 rajveer 5801
    @Override
5802
    public void clear() {
5803
      this.couponCode = null;
5804
      setUserIdIsSet(false);
5805
      this.userId = 0;
1982 varun.gupt 5806
    }
5807
 
5808
    public String getCouponCode() {
5809
      return this.couponCode;
5810
    }
5811
 
3430 rajveer 5812
    public void setCouponCode(String couponCode) {
1982 varun.gupt 5813
      this.couponCode = couponCode;
5814
    }
5815
 
5816
    public void unsetCouponCode() {
5817
      this.couponCode = null;
5818
    }
5819
 
3430 rajveer 5820
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 5821
    public boolean isSetCouponCode() {
5822
      return this.couponCode != null;
5823
    }
5824
 
5825
    public void setCouponCodeIsSet(boolean value) {
5826
      if (!value) {
5827
        this.couponCode = null;
5828
      }
5829
    }
5830
 
5831
    public long getUserId() {
5832
      return this.userId;
5833
    }
5834
 
3430 rajveer 5835
    public void setUserId(long userId) {
1982 varun.gupt 5836
      this.userId = userId;
5837
      setUserIdIsSet(true);
5838
    }
5839
 
5840
    public void unsetUserId() {
5841
      __isset_bit_vector.clear(__USERID_ISSET_ID);
5842
    }
5843
 
3430 rajveer 5844
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 5845
    public boolean isSetUserId() {
5846
      return __isset_bit_vector.get(__USERID_ISSET_ID);
5847
    }
5848
 
5849
    public void setUserIdIsSet(boolean value) {
5850
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
5851
    }
5852
 
5853
    public void setFieldValue(_Fields field, Object value) {
5854
      switch (field) {
5855
      case COUPON_CODE:
5856
        if (value == null) {
5857
          unsetCouponCode();
5858
        } else {
5859
          setCouponCode((String)value);
5860
        }
5861
        break;
5862
 
5863
      case USER_ID:
5864
        if (value == null) {
5865
          unsetUserId();
5866
        } else {
5867
          setUserId((Long)value);
5868
        }
5869
        break;
5870
 
5871
      }
5872
    }
5873
 
5874
    public Object getFieldValue(_Fields field) {
5875
      switch (field) {
5876
      case COUPON_CODE:
5877
        return getCouponCode();
5878
 
5879
      case USER_ID:
3430 rajveer 5880
        return Long.valueOf(getUserId());
1982 varun.gupt 5881
 
5882
      }
5883
      throw new IllegalStateException();
5884
    }
5885
 
3430 rajveer 5886
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
5887
    public boolean isSet(_Fields field) {
5888
      if (field == null) {
5889
        throw new IllegalArgumentException();
5890
      }
1982 varun.gupt 5891
 
5892
      switch (field) {
5893
      case COUPON_CODE:
5894
        return isSetCouponCode();
5895
      case USER_ID:
5896
        return isSetUserId();
5897
      }
5898
      throw new IllegalStateException();
5899
    }
5900
 
5901
    @Override
5902
    public boolean equals(Object that) {
5903
      if (that == null)
5904
        return false;
5905
      if (that instanceof getCouponUsageCountByUser_args)
5906
        return this.equals((getCouponUsageCountByUser_args)that);
5907
      return false;
5908
    }
5909
 
5910
    public boolean equals(getCouponUsageCountByUser_args that) {
5911
      if (that == null)
5912
        return false;
5913
 
5914
      boolean this_present_couponCode = true && this.isSetCouponCode();
5915
      boolean that_present_couponCode = true && that.isSetCouponCode();
5916
      if (this_present_couponCode || that_present_couponCode) {
5917
        if (!(this_present_couponCode && that_present_couponCode))
5918
          return false;
5919
        if (!this.couponCode.equals(that.couponCode))
5920
          return false;
5921
      }
5922
 
5923
      boolean this_present_userId = true;
5924
      boolean that_present_userId = true;
5925
      if (this_present_userId || that_present_userId) {
5926
        if (!(this_present_userId && that_present_userId))
5927
          return false;
5928
        if (this.userId != that.userId)
5929
          return false;
5930
      }
5931
 
5932
      return true;
5933
    }
5934
 
5935
    @Override
5936
    public int hashCode() {
5937
      return 0;
5938
    }
5939
 
5940
    public int compareTo(getCouponUsageCountByUser_args other) {
5941
      if (!getClass().equals(other.getClass())) {
5942
        return getClass().getName().compareTo(other.getClass().getName());
5943
      }
5944
 
5945
      int lastComparison = 0;
5946
      getCouponUsageCountByUser_args typedOther = (getCouponUsageCountByUser_args)other;
5947
 
3430 rajveer 5948
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 5949
      if (lastComparison != 0) {
5950
        return lastComparison;
5951
      }
3430 rajveer 5952
      if (isSetCouponCode()) {
5953
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
5954
        if (lastComparison != 0) {
5955
          return lastComparison;
5956
        }
1982 varun.gupt 5957
      }
3430 rajveer 5958
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
1982 varun.gupt 5959
      if (lastComparison != 0) {
5960
        return lastComparison;
5961
      }
3430 rajveer 5962
      if (isSetUserId()) {
5963
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
5964
        if (lastComparison != 0) {
5965
          return lastComparison;
5966
        }
1982 varun.gupt 5967
      }
5968
      return 0;
5969
    }
5970
 
3430 rajveer 5971
    public _Fields fieldForId(int fieldId) {
5972
      return _Fields.findByThriftId(fieldId);
5973
    }
5974
 
5975
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
5976
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 5977
      iprot.readStructBegin();
5978
      while (true)
5979
      {
5980
        field = iprot.readFieldBegin();
3430 rajveer 5981
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 5982
          break;
5983
        }
3430 rajveer 5984
        switch (field.id) {
5985
          case 1: // COUPON_CODE
5986
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
5987
              this.couponCode = iprot.readString();
5988
            } else { 
5989
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5990
            }
5991
            break;
5992
          case 2: // USER_ID
5993
            if (field.type == org.apache.thrift.protocol.TType.I64) {
5994
              this.userId = iprot.readI64();
5995
              setUserIdIsSet(true);
5996
            } else { 
5997
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5998
            }
5999
            break;
6000
          default:
6001
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 6002
        }
3430 rajveer 6003
        iprot.readFieldEnd();
1982 varun.gupt 6004
      }
6005
      iprot.readStructEnd();
6006
      validate();
6007
    }
6008
 
3430 rajveer 6009
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 6010
      validate();
6011
 
6012
      oprot.writeStructBegin(STRUCT_DESC);
6013
      if (this.couponCode != null) {
6014
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
6015
        oprot.writeString(this.couponCode);
6016
        oprot.writeFieldEnd();
6017
      }
6018
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
6019
      oprot.writeI64(this.userId);
6020
      oprot.writeFieldEnd();
6021
      oprot.writeFieldStop();
6022
      oprot.writeStructEnd();
6023
    }
6024
 
6025
    @Override
6026
    public String toString() {
6027
      StringBuilder sb = new StringBuilder("getCouponUsageCountByUser_args(");
6028
      boolean first = true;
6029
 
6030
      sb.append("couponCode:");
6031
      if (this.couponCode == null) {
6032
        sb.append("null");
6033
      } else {
6034
        sb.append(this.couponCode);
6035
      }
6036
      first = false;
6037
      if (!first) sb.append(", ");
6038
      sb.append("userId:");
6039
      sb.append(this.userId);
6040
      first = false;
6041
      sb.append(")");
6042
      return sb.toString();
6043
    }
6044
 
3430 rajveer 6045
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 6046
      // check for required fields
6047
    }
6048
 
3430 rajveer 6049
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
6050
      try {
6051
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
6052
      } catch (org.apache.thrift.TException te) {
6053
        throw new java.io.IOException(te);
6054
      }
6055
    }
6056
 
6057
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
6058
      try {
6059
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
6060
        __isset_bit_vector = new BitSet(1);
6061
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
6062
      } catch (org.apache.thrift.TException te) {
6063
        throw new java.io.IOException(te);
6064
      }
6065
    }
6066
 
1982 varun.gupt 6067
  }
6068
 
3430 rajveer 6069
  public static class getCouponUsageCountByUser_result implements org.apache.thrift.TBase<getCouponUsageCountByUser_result, getCouponUsageCountByUser_result._Fields>, java.io.Serializable, Cloneable   {
6070
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCouponUsageCountByUser_result");
1982 varun.gupt 6071
 
3430 rajveer 6072
    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);
6073
    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 6074
 
3430 rajveer 6075
    private long success; // required
6076
    private PromotionException pex; // required
1982 varun.gupt 6077
 
6078
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 6079
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 6080
      SUCCESS((short)0, "success"),
6081
      PEX((short)1, "pex");
6082
 
6083
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6084
 
6085
      static {
6086
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6087
          byName.put(field.getFieldName(), field);
6088
        }
6089
      }
6090
 
6091
      /**
6092
       * Find the _Fields constant that matches fieldId, or null if its not found.
6093
       */
6094
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 6095
        switch(fieldId) {
6096
          case 0: // SUCCESS
6097
            return SUCCESS;
6098
          case 1: // PEX
6099
            return PEX;
6100
          default:
6101
            return null;
6102
        }
1982 varun.gupt 6103
      }
6104
 
6105
      /**
6106
       * Find the _Fields constant that matches fieldId, throwing an exception
6107
       * if it is not found.
6108
       */
6109
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6110
        _Fields fields = findByThriftId(fieldId);
6111
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6112
        return fields;
6113
      }
6114
 
6115
      /**
6116
       * Find the _Fields constant that matches name, or null if its not found.
6117
       */
6118
      public static _Fields findByName(String name) {
6119
        return byName.get(name);
6120
      }
6121
 
6122
      private final short _thriftId;
6123
      private final String _fieldName;
6124
 
6125
      _Fields(short thriftId, String fieldName) {
6126
        _thriftId = thriftId;
6127
        _fieldName = fieldName;
6128
      }
6129
 
6130
      public short getThriftFieldId() {
6131
        return _thriftId;
6132
      }
6133
 
6134
      public String getFieldName() {
6135
        return _fieldName;
6136
      }
6137
    }
6138
 
6139
    // isset id assignments
6140
    private static final int __SUCCESS_ISSET_ID = 0;
6141
    private BitSet __isset_bit_vector = new BitSet(1);
6142
 
3430 rajveer 6143
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 6144
    static {
3430 rajveer 6145
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
6146
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6147
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
6148
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6149
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
6150
      metaDataMap = Collections.unmodifiableMap(tmpMap);
6151
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCouponUsageCountByUser_result.class, metaDataMap);
1982 varun.gupt 6152
    }
6153
 
6154
    public getCouponUsageCountByUser_result() {
6155
    }
6156
 
6157
    public getCouponUsageCountByUser_result(
6158
      long success,
6159
      PromotionException pex)
6160
    {
6161
      this();
6162
      this.success = success;
6163
      setSuccessIsSet(true);
6164
      this.pex = pex;
6165
    }
6166
 
6167
    /**
6168
     * Performs a deep copy on <i>other</i>.
6169
     */
6170
    public getCouponUsageCountByUser_result(getCouponUsageCountByUser_result other) {
6171
      __isset_bit_vector.clear();
6172
      __isset_bit_vector.or(other.__isset_bit_vector);
6173
      this.success = other.success;
6174
      if (other.isSetPex()) {
6175
        this.pex = new PromotionException(other.pex);
6176
      }
6177
    }
6178
 
6179
    public getCouponUsageCountByUser_result deepCopy() {
6180
      return new getCouponUsageCountByUser_result(this);
6181
    }
6182
 
3430 rajveer 6183
    @Override
6184
    public void clear() {
6185
      setSuccessIsSet(false);
6186
      this.success = 0;
6187
      this.pex = null;
1982 varun.gupt 6188
    }
6189
 
6190
    public long getSuccess() {
6191
      return this.success;
6192
    }
6193
 
3430 rajveer 6194
    public void setSuccess(long success) {
1982 varun.gupt 6195
      this.success = success;
6196
      setSuccessIsSet(true);
6197
    }
6198
 
6199
    public void unsetSuccess() {
6200
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
6201
    }
6202
 
3430 rajveer 6203
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6204
    public boolean isSetSuccess() {
6205
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
6206
    }
6207
 
6208
    public void setSuccessIsSet(boolean value) {
6209
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
6210
    }
6211
 
6212
    public PromotionException getPex() {
6213
      return this.pex;
6214
    }
6215
 
3430 rajveer 6216
    public void setPex(PromotionException pex) {
1982 varun.gupt 6217
      this.pex = pex;
6218
    }
6219
 
6220
    public void unsetPex() {
6221
      this.pex = null;
6222
    }
6223
 
3430 rajveer 6224
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6225
    public boolean isSetPex() {
6226
      return this.pex != null;
6227
    }
6228
 
6229
    public void setPexIsSet(boolean value) {
6230
      if (!value) {
6231
        this.pex = null;
6232
      }
6233
    }
6234
 
6235
    public void setFieldValue(_Fields field, Object value) {
6236
      switch (field) {
6237
      case SUCCESS:
6238
        if (value == null) {
6239
          unsetSuccess();
6240
        } else {
6241
          setSuccess((Long)value);
6242
        }
6243
        break;
6244
 
6245
      case PEX:
6246
        if (value == null) {
6247
          unsetPex();
6248
        } else {
6249
          setPex((PromotionException)value);
6250
        }
6251
        break;
6252
 
6253
      }
6254
    }
6255
 
6256
    public Object getFieldValue(_Fields field) {
6257
      switch (field) {
6258
      case SUCCESS:
3430 rajveer 6259
        return Long.valueOf(getSuccess());
1982 varun.gupt 6260
 
6261
      case PEX:
6262
        return getPex();
6263
 
6264
      }
6265
      throw new IllegalStateException();
6266
    }
6267
 
3430 rajveer 6268
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
6269
    public boolean isSet(_Fields field) {
6270
      if (field == null) {
6271
        throw new IllegalArgumentException();
6272
      }
1982 varun.gupt 6273
 
6274
      switch (field) {
6275
      case SUCCESS:
6276
        return isSetSuccess();
6277
      case PEX:
6278
        return isSetPex();
6279
      }
6280
      throw new IllegalStateException();
6281
    }
6282
 
6283
    @Override
6284
    public boolean equals(Object that) {
6285
      if (that == null)
6286
        return false;
6287
      if (that instanceof getCouponUsageCountByUser_result)
6288
        return this.equals((getCouponUsageCountByUser_result)that);
6289
      return false;
6290
    }
6291
 
6292
    public boolean equals(getCouponUsageCountByUser_result that) {
6293
      if (that == null)
6294
        return false;
6295
 
6296
      boolean this_present_success = true;
6297
      boolean that_present_success = true;
6298
      if (this_present_success || that_present_success) {
6299
        if (!(this_present_success && that_present_success))
6300
          return false;
6301
        if (this.success != that.success)
6302
          return false;
6303
      }
6304
 
6305
      boolean this_present_pex = true && this.isSetPex();
6306
      boolean that_present_pex = true && that.isSetPex();
6307
      if (this_present_pex || that_present_pex) {
6308
        if (!(this_present_pex && that_present_pex))
6309
          return false;
6310
        if (!this.pex.equals(that.pex))
6311
          return false;
6312
      }
6313
 
6314
      return true;
6315
    }
6316
 
6317
    @Override
6318
    public int hashCode() {
6319
      return 0;
6320
    }
6321
 
6322
    public int compareTo(getCouponUsageCountByUser_result other) {
6323
      if (!getClass().equals(other.getClass())) {
6324
        return getClass().getName().compareTo(other.getClass().getName());
6325
      }
6326
 
6327
      int lastComparison = 0;
6328
      getCouponUsageCountByUser_result typedOther = (getCouponUsageCountByUser_result)other;
6329
 
3430 rajveer 6330
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 6331
      if (lastComparison != 0) {
6332
        return lastComparison;
6333
      }
3430 rajveer 6334
      if (isSetSuccess()) {
6335
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
6336
        if (lastComparison != 0) {
6337
          return lastComparison;
6338
        }
1982 varun.gupt 6339
      }
3430 rajveer 6340
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 6341
      if (lastComparison != 0) {
6342
        return lastComparison;
6343
      }
3430 rajveer 6344
      if (isSetPex()) {
6345
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
6346
        if (lastComparison != 0) {
6347
          return lastComparison;
6348
        }
1982 varun.gupt 6349
      }
6350
      return 0;
6351
    }
6352
 
3430 rajveer 6353
    public _Fields fieldForId(int fieldId) {
6354
      return _Fields.findByThriftId(fieldId);
6355
    }
6356
 
6357
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
6358
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 6359
      iprot.readStructBegin();
6360
      while (true)
6361
      {
6362
        field = iprot.readFieldBegin();
3430 rajveer 6363
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 6364
          break;
6365
        }
3430 rajveer 6366
        switch (field.id) {
6367
          case 0: // SUCCESS
6368
            if (field.type == org.apache.thrift.protocol.TType.I64) {
6369
              this.success = iprot.readI64();
6370
              setSuccessIsSet(true);
6371
            } else { 
6372
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6373
            }
6374
            break;
6375
          case 1: // PEX
6376
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
6377
              this.pex = new PromotionException();
6378
              this.pex.read(iprot);
6379
            } else { 
6380
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6381
            }
6382
            break;
6383
          default:
6384
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 6385
        }
3430 rajveer 6386
        iprot.readFieldEnd();
1982 varun.gupt 6387
      }
6388
      iprot.readStructEnd();
6389
      validate();
6390
    }
6391
 
3430 rajveer 6392
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 6393
      oprot.writeStructBegin(STRUCT_DESC);
6394
 
6395
      if (this.isSetSuccess()) {
6396
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
6397
        oprot.writeI64(this.success);
6398
        oprot.writeFieldEnd();
6399
      } else if (this.isSetPex()) {
6400
        oprot.writeFieldBegin(PEX_FIELD_DESC);
6401
        this.pex.write(oprot);
6402
        oprot.writeFieldEnd();
6403
      }
6404
      oprot.writeFieldStop();
6405
      oprot.writeStructEnd();
6406
    }
6407
 
6408
    @Override
6409
    public String toString() {
6410
      StringBuilder sb = new StringBuilder("getCouponUsageCountByUser_result(");
6411
      boolean first = true;
6412
 
6413
      sb.append("success:");
6414
      sb.append(this.success);
6415
      first = false;
6416
      if (!first) sb.append(", ");
6417
      sb.append("pex:");
6418
      if (this.pex == null) {
6419
        sb.append("null");
6420
      } else {
6421
        sb.append(this.pex);
6422
      }
6423
      first = false;
6424
      sb.append(")");
6425
      return sb.toString();
6426
    }
6427
 
3430 rajveer 6428
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 6429
      // check for required fields
6430
    }
6431
 
3430 rajveer 6432
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
6433
      try {
6434
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
6435
      } catch (org.apache.thrift.TException te) {
6436
        throw new java.io.IOException(te);
6437
      }
6438
    }
6439
 
6440
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
6441
      try {
6442
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
6443
      } catch (org.apache.thrift.TException te) {
6444
        throw new java.io.IOException(te);
6445
      }
6446
    }
6447
 
1982 varun.gupt 6448
  }
6449
 
3430 rajveer 6450
  public static class getActiveCoupons_args implements org.apache.thrift.TBase<getActiveCoupons_args, getActiveCoupons_args._Fields>, java.io.Serializable, Cloneable   {
6451
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActiveCoupons_args");
3385 varun.gupt 6452
 
6453
 
6454
 
6455
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 6456
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 6457
;
6458
 
6459
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6460
 
6461
      static {
6462
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6463
          byName.put(field.getFieldName(), field);
6464
        }
6465
      }
6466
 
6467
      /**
6468
       * Find the _Fields constant that matches fieldId, or null if its not found.
6469
       */
6470
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 6471
        switch(fieldId) {
6472
          default:
6473
            return null;
6474
        }
3385 varun.gupt 6475
      }
6476
 
6477
      /**
6478
       * Find the _Fields constant that matches fieldId, throwing an exception
6479
       * if it is not found.
6480
       */
6481
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6482
        _Fields fields = findByThriftId(fieldId);
6483
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6484
        return fields;
6485
      }
6486
 
6487
      /**
6488
       * Find the _Fields constant that matches name, or null if its not found.
6489
       */
6490
      public static _Fields findByName(String name) {
6491
        return byName.get(name);
6492
      }
6493
 
6494
      private final short _thriftId;
6495
      private final String _fieldName;
6496
 
6497
      _Fields(short thriftId, String fieldName) {
6498
        _thriftId = thriftId;
6499
        _fieldName = fieldName;
6500
      }
6501
 
6502
      public short getThriftFieldId() {
6503
        return _thriftId;
6504
      }
6505
 
6506
      public String getFieldName() {
6507
        return _fieldName;
6508
      }
6509
    }
3430 rajveer 6510
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 6511
    static {
3430 rajveer 6512
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
6513
      metaDataMap = Collections.unmodifiableMap(tmpMap);
6514
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActiveCoupons_args.class, metaDataMap);
3385 varun.gupt 6515
    }
6516
 
6517
    public getActiveCoupons_args() {
6518
    }
6519
 
6520
    /**
6521
     * Performs a deep copy on <i>other</i>.
6522
     */
6523
    public getActiveCoupons_args(getActiveCoupons_args other) {
6524
    }
6525
 
6526
    public getActiveCoupons_args deepCopy() {
6527
      return new getActiveCoupons_args(this);
6528
    }
6529
 
3430 rajveer 6530
    @Override
6531
    public void clear() {
3385 varun.gupt 6532
    }
6533
 
6534
    public void setFieldValue(_Fields field, Object value) {
6535
      switch (field) {
6536
      }
6537
    }
6538
 
6539
    public Object getFieldValue(_Fields field) {
6540
      switch (field) {
6541
      }
6542
      throw new IllegalStateException();
6543
    }
6544
 
3430 rajveer 6545
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
6546
    public boolean isSet(_Fields field) {
6547
      if (field == null) {
6548
        throw new IllegalArgumentException();
6549
      }
3385 varun.gupt 6550
 
6551
      switch (field) {
6552
      }
6553
      throw new IllegalStateException();
6554
    }
6555
 
6556
    @Override
6557
    public boolean equals(Object that) {
6558
      if (that == null)
6559
        return false;
6560
      if (that instanceof getActiveCoupons_args)
6561
        return this.equals((getActiveCoupons_args)that);
6562
      return false;
6563
    }
6564
 
6565
    public boolean equals(getActiveCoupons_args that) {
6566
      if (that == null)
6567
        return false;
6568
 
6569
      return true;
6570
    }
6571
 
6572
    @Override
6573
    public int hashCode() {
6574
      return 0;
6575
    }
6576
 
6577
    public int compareTo(getActiveCoupons_args other) {
6578
      if (!getClass().equals(other.getClass())) {
6579
        return getClass().getName().compareTo(other.getClass().getName());
6580
      }
6581
 
6582
      int lastComparison = 0;
6583
      getActiveCoupons_args typedOther = (getActiveCoupons_args)other;
6584
 
6585
      return 0;
6586
    }
6587
 
3430 rajveer 6588
    public _Fields fieldForId(int fieldId) {
6589
      return _Fields.findByThriftId(fieldId);
6590
    }
6591
 
6592
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
6593
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 6594
      iprot.readStructBegin();
6595
      while (true)
6596
      {
6597
        field = iprot.readFieldBegin();
3430 rajveer 6598
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 6599
          break;
6600
        }
3430 rajveer 6601
        switch (field.id) {
6602
          default:
6603
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 6604
        }
3430 rajveer 6605
        iprot.readFieldEnd();
3385 varun.gupt 6606
      }
6607
      iprot.readStructEnd();
6608
      validate();
6609
    }
6610
 
3430 rajveer 6611
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 6612
      validate();
6613
 
6614
      oprot.writeStructBegin(STRUCT_DESC);
6615
      oprot.writeFieldStop();
6616
      oprot.writeStructEnd();
6617
    }
6618
 
6619
    @Override
6620
    public String toString() {
6621
      StringBuilder sb = new StringBuilder("getActiveCoupons_args(");
6622
      boolean first = true;
6623
 
6624
      sb.append(")");
6625
      return sb.toString();
6626
    }
6627
 
3430 rajveer 6628
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 6629
      // check for required fields
6630
    }
6631
 
3430 rajveer 6632
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
6633
      try {
6634
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
6635
      } catch (org.apache.thrift.TException te) {
6636
        throw new java.io.IOException(te);
6637
      }
6638
    }
6639
 
6640
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
6641
      try {
6642
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
6643
      } catch (org.apache.thrift.TException te) {
6644
        throw new java.io.IOException(te);
6645
      }
6646
    }
6647
 
3385 varun.gupt 6648
  }
6649
 
3430 rajveer 6650
  public static class getActiveCoupons_result implements org.apache.thrift.TBase<getActiveCoupons_result, getActiveCoupons_result._Fields>, java.io.Serializable, Cloneable   {
6651
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActiveCoupons_result");
3385 varun.gupt 6652
 
3430 rajveer 6653
    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);
6654
    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 6655
 
3430 rajveer 6656
    private List<Coupon> success; // required
6657
    private PromotionException pex; // required
3385 varun.gupt 6658
 
6659
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 6660
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 6661
      SUCCESS((short)0, "success"),
6662
      PEX((short)1, "pex");
6663
 
6664
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6665
 
6666
      static {
6667
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6668
          byName.put(field.getFieldName(), field);
6669
        }
6670
      }
6671
 
6672
      /**
6673
       * Find the _Fields constant that matches fieldId, or null if its not found.
6674
       */
6675
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 6676
        switch(fieldId) {
6677
          case 0: // SUCCESS
6678
            return SUCCESS;
6679
          case 1: // PEX
6680
            return PEX;
6681
          default:
6682
            return null;
6683
        }
3385 varun.gupt 6684
      }
6685
 
6686
      /**
6687
       * Find the _Fields constant that matches fieldId, throwing an exception
6688
       * if it is not found.
6689
       */
6690
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6691
        _Fields fields = findByThriftId(fieldId);
6692
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6693
        return fields;
6694
      }
6695
 
6696
      /**
6697
       * Find the _Fields constant that matches name, or null if its not found.
6698
       */
6699
      public static _Fields findByName(String name) {
6700
        return byName.get(name);
6701
      }
6702
 
6703
      private final short _thriftId;
6704
      private final String _fieldName;
6705
 
6706
      _Fields(short thriftId, String fieldName) {
6707
        _thriftId = thriftId;
6708
        _fieldName = fieldName;
6709
      }
6710
 
6711
      public short getThriftFieldId() {
6712
        return _thriftId;
6713
      }
6714
 
6715
      public String getFieldName() {
6716
        return _fieldName;
6717
      }
6718
    }
6719
 
6720
    // isset id assignments
6721
 
3430 rajveer 6722
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 6723
    static {
3430 rajveer 6724
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
6725
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6726
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
6727
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Coupon.class))));
6728
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6729
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
6730
      metaDataMap = Collections.unmodifiableMap(tmpMap);
6731
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActiveCoupons_result.class, metaDataMap);
3385 varun.gupt 6732
    }
6733
 
6734
    public getActiveCoupons_result() {
6735
    }
6736
 
6737
    public getActiveCoupons_result(
6738
      List<Coupon> success,
6739
      PromotionException pex)
6740
    {
6741
      this();
6742
      this.success = success;
6743
      this.pex = pex;
6744
    }
6745
 
6746
    /**
6747
     * Performs a deep copy on <i>other</i>.
6748
     */
6749
    public getActiveCoupons_result(getActiveCoupons_result other) {
6750
      if (other.isSetSuccess()) {
6751
        List<Coupon> __this__success = new ArrayList<Coupon>();
6752
        for (Coupon other_element : other.success) {
6753
          __this__success.add(new Coupon(other_element));
6754
        }
6755
        this.success = __this__success;
6756
      }
6757
      if (other.isSetPex()) {
6758
        this.pex = new PromotionException(other.pex);
6759
      }
6760
    }
6761
 
6762
    public getActiveCoupons_result deepCopy() {
6763
      return new getActiveCoupons_result(this);
6764
    }
6765
 
3430 rajveer 6766
    @Override
6767
    public void clear() {
6768
      this.success = null;
6769
      this.pex = null;
3385 varun.gupt 6770
    }
6771
 
6772
    public int getSuccessSize() {
6773
      return (this.success == null) ? 0 : this.success.size();
6774
    }
6775
 
6776
    public java.util.Iterator<Coupon> getSuccessIterator() {
6777
      return (this.success == null) ? null : this.success.iterator();
6778
    }
6779
 
6780
    public void addToSuccess(Coupon elem) {
6781
      if (this.success == null) {
6782
        this.success = new ArrayList<Coupon>();
6783
      }
6784
      this.success.add(elem);
6785
    }
6786
 
6787
    public List<Coupon> getSuccess() {
6788
      return this.success;
6789
    }
6790
 
3430 rajveer 6791
    public void setSuccess(List<Coupon> success) {
3385 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 */
3385 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) {
3385 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 */
3385 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((List<Coupon>)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
      }
3385 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 getActiveCoupons_result)
6886
        return this.equals((getActiveCoupons_result)that);
6887
      return false;
6888
    }
6889
 
6890
    public boolean equals(getActiveCoupons_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(getActiveCoupons_result other) {
6921
      if (!getClass().equals(other.getClass())) {
6922
        return getClass().getName().compareTo(other.getClass().getName());
6923
      }
6924
 
6925
      int lastComparison = 0;
6926
      getActiveCoupons_result typedOther = (getActiveCoupons_result)other;
6927
 
3430 rajveer 6928
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3385 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
        }
3385 varun.gupt 6937
      }
3430 rajveer 6938
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
3385 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
        }
3385 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;
3385 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) { 
3385 varun.gupt 6962
          break;
6963
        }
3430 rajveer 6964
        switch (field.id) {
6965
          case 0: // SUCCESS
6966
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
6967
              {
5327 rajveer 6968
                org.apache.thrift.protocol.TList _list16 = iprot.readListBegin();
6969
                this.success = new ArrayList<Coupon>(_list16.size);
6970
                for (int _i17 = 0; _i17 < _list16.size; ++_i17)
3385 varun.gupt 6971
                {
5327 rajveer 6972
                  Coupon _elem18; // required
6973
                  _elem18 = new Coupon();
6974
                  _elem18.read(iprot);
6975
                  this.success.add(_elem18);
3385 varun.gupt 6976
                }
3430 rajveer 6977
                iprot.readListEnd();
3385 varun.gupt 6978
              }
3430 rajveer 6979
            } else { 
6980
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6981
            }
6982
            break;
6983
          case 1: // PEX
6984
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
6985
              this.pex = new PromotionException();
6986
              this.pex.read(iprot);
6987
            } else { 
6988
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6989
            }
6990
            break;
6991
          default:
6992
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 6993
        }
3430 rajveer 6994
        iprot.readFieldEnd();
3385 varun.gupt 6995
      }
6996
      iprot.readStructEnd();
6997
      validate();
6998
    }
6999
 
3430 rajveer 7000
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 7001
      oprot.writeStructBegin(STRUCT_DESC);
7002
 
7003
      if (this.isSetSuccess()) {
7004
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
7005
        {
3430 rajveer 7006
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
5327 rajveer 7007
          for (Coupon _iter19 : this.success)
3385 varun.gupt 7008
          {
5327 rajveer 7009
            _iter19.write(oprot);
3385 varun.gupt 7010
          }
7011
          oprot.writeListEnd();
7012
        }
7013
        oprot.writeFieldEnd();
7014
      } else if (this.isSetPex()) {
7015
        oprot.writeFieldBegin(PEX_FIELD_DESC);
7016
        this.pex.write(oprot);
7017
        oprot.writeFieldEnd();
7018
      }
7019
      oprot.writeFieldStop();
7020
      oprot.writeStructEnd();
7021
    }
7022
 
7023
    @Override
7024
    public String toString() {
7025
      StringBuilder sb = new StringBuilder("getActiveCoupons_result(");
7026
      boolean first = true;
7027
 
7028
      sb.append("success:");
7029
      if (this.success == null) {
7030
        sb.append("null");
7031
      } else {
7032
        sb.append(this.success);
7033
      }
7034
      first = false;
7035
      if (!first) sb.append(", ");
7036
      sb.append("pex:");
7037
      if (this.pex == null) {
7038
        sb.append("null");
7039
      } else {
7040
        sb.append(this.pex);
7041
      }
7042
      first = false;
7043
      sb.append(")");
7044
      return sb.toString();
7045
    }
7046
 
3430 rajveer 7047
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 7048
      // check for required fields
7049
    }
7050
 
3430 rajveer 7051
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
7052
      try {
7053
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
7054
      } catch (org.apache.thrift.TException te) {
7055
        throw new java.io.IOException(te);
7056
      }
7057
    }
7058
 
7059
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
7060
      try {
7061
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
7062
      } catch (org.apache.thrift.TException te) {
7063
        throw new java.io.IOException(te);
7064
      }
7065
    }
7066
 
3385 varun.gupt 7067
  }
7068
 
3430 rajveer 7069
  public static class getSuccessfulPaymentCountForCoupon_args implements org.apache.thrift.TBase<getSuccessfulPaymentCountForCoupon_args, getSuccessfulPaymentCountForCoupon_args._Fields>, java.io.Serializable, Cloneable   {
7070
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSuccessfulPaymentCountForCoupon_args");
3385 varun.gupt 7071
 
3430 rajveer 7072
    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 7073
 
3430 rajveer 7074
    private String couponCode; // required
3385 varun.gupt 7075
 
7076
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 7077
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 7078
      COUPON_CODE((short)1, "couponCode");
7079
 
7080
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7081
 
7082
      static {
7083
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7084
          byName.put(field.getFieldName(), field);
7085
        }
7086
      }
7087
 
7088
      /**
7089
       * Find the _Fields constant that matches fieldId, or null if its not found.
7090
       */
7091
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 7092
        switch(fieldId) {
7093
          case 1: // COUPON_CODE
7094
            return COUPON_CODE;
7095
          default:
7096
            return null;
7097
        }
3385 varun.gupt 7098
      }
7099
 
7100
      /**
7101
       * Find the _Fields constant that matches fieldId, throwing an exception
7102
       * if it is not found.
7103
       */
7104
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7105
        _Fields fields = findByThriftId(fieldId);
7106
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7107
        return fields;
7108
      }
7109
 
7110
      /**
7111
       * Find the _Fields constant that matches name, or null if its not found.
7112
       */
7113
      public static _Fields findByName(String name) {
7114
        return byName.get(name);
7115
      }
7116
 
7117
      private final short _thriftId;
7118
      private final String _fieldName;
7119
 
7120
      _Fields(short thriftId, String fieldName) {
7121
        _thriftId = thriftId;
7122
        _fieldName = fieldName;
7123
      }
7124
 
7125
      public short getThriftFieldId() {
7126
        return _thriftId;
7127
      }
7128
 
7129
      public String getFieldName() {
7130
        return _fieldName;
7131
      }
7132
    }
7133
 
7134
    // isset id assignments
7135
 
3430 rajveer 7136
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 7137
    static {
3430 rajveer 7138
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
7139
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7140
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
7141
      metaDataMap = Collections.unmodifiableMap(tmpMap);
7142
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSuccessfulPaymentCountForCoupon_args.class, metaDataMap);
3385 varun.gupt 7143
    }
7144
 
7145
    public getSuccessfulPaymentCountForCoupon_args() {
7146
    }
7147
 
7148
    public getSuccessfulPaymentCountForCoupon_args(
7149
      String couponCode)
7150
    {
7151
      this();
7152
      this.couponCode = couponCode;
7153
    }
7154
 
7155
    /**
7156
     * Performs a deep copy on <i>other</i>.
7157
     */
7158
    public getSuccessfulPaymentCountForCoupon_args(getSuccessfulPaymentCountForCoupon_args other) {
7159
      if (other.isSetCouponCode()) {
7160
        this.couponCode = other.couponCode;
7161
      }
7162
    }
7163
 
7164
    public getSuccessfulPaymentCountForCoupon_args deepCopy() {
7165
      return new getSuccessfulPaymentCountForCoupon_args(this);
7166
    }
7167
 
3430 rajveer 7168
    @Override
7169
    public void clear() {
7170
      this.couponCode = null;
3385 varun.gupt 7171
    }
7172
 
7173
    public String getCouponCode() {
7174
      return this.couponCode;
7175
    }
7176
 
3430 rajveer 7177
    public void setCouponCode(String couponCode) {
3385 varun.gupt 7178
      this.couponCode = couponCode;
7179
    }
7180
 
7181
    public void unsetCouponCode() {
7182
      this.couponCode = null;
7183
    }
7184
 
3430 rajveer 7185
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
3385 varun.gupt 7186
    public boolean isSetCouponCode() {
7187
      return this.couponCode != null;
7188
    }
7189
 
7190
    public void setCouponCodeIsSet(boolean value) {
7191
      if (!value) {
7192
        this.couponCode = null;
7193
      }
7194
    }
7195
 
7196
    public void setFieldValue(_Fields field, Object value) {
7197
      switch (field) {
7198
      case COUPON_CODE:
7199
        if (value == null) {
7200
          unsetCouponCode();
7201
        } else {
7202
          setCouponCode((String)value);
7203
        }
7204
        break;
7205
 
7206
      }
7207
    }
7208
 
7209
    public Object getFieldValue(_Fields field) {
7210
      switch (field) {
7211
      case COUPON_CODE:
7212
        return getCouponCode();
7213
 
7214
      }
7215
      throw new IllegalStateException();
7216
    }
7217
 
3430 rajveer 7218
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
7219
    public boolean isSet(_Fields field) {
7220
      if (field == null) {
7221
        throw new IllegalArgumentException();
7222
      }
3385 varun.gupt 7223
 
7224
      switch (field) {
7225
      case COUPON_CODE:
7226
        return isSetCouponCode();
7227
      }
7228
      throw new IllegalStateException();
7229
    }
7230
 
7231
    @Override
7232
    public boolean equals(Object that) {
7233
      if (that == null)
7234
        return false;
7235
      if (that instanceof getSuccessfulPaymentCountForCoupon_args)
7236
        return this.equals((getSuccessfulPaymentCountForCoupon_args)that);
7237
      return false;
7238
    }
7239
 
7240
    public boolean equals(getSuccessfulPaymentCountForCoupon_args that) {
7241
      if (that == null)
7242
        return false;
7243
 
7244
      boolean this_present_couponCode = true && this.isSetCouponCode();
7245
      boolean that_present_couponCode = true && that.isSetCouponCode();
7246
      if (this_present_couponCode || that_present_couponCode) {
7247
        if (!(this_present_couponCode && that_present_couponCode))
7248
          return false;
7249
        if (!this.couponCode.equals(that.couponCode))
7250
          return false;
7251
      }
7252
 
7253
      return true;
7254
    }
7255
 
7256
    @Override
7257
    public int hashCode() {
7258
      return 0;
7259
    }
7260
 
7261
    public int compareTo(getSuccessfulPaymentCountForCoupon_args other) {
7262
      if (!getClass().equals(other.getClass())) {
7263
        return getClass().getName().compareTo(other.getClass().getName());
7264
      }
7265
 
7266
      int lastComparison = 0;
7267
      getSuccessfulPaymentCountForCoupon_args typedOther = (getSuccessfulPaymentCountForCoupon_args)other;
7268
 
3430 rajveer 7269
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
3385 varun.gupt 7270
      if (lastComparison != 0) {
7271
        return lastComparison;
7272
      }
3430 rajveer 7273
      if (isSetCouponCode()) {
7274
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
7275
        if (lastComparison != 0) {
7276
          return lastComparison;
7277
        }
3385 varun.gupt 7278
      }
7279
      return 0;
7280
    }
7281
 
3430 rajveer 7282
    public _Fields fieldForId(int fieldId) {
7283
      return _Fields.findByThriftId(fieldId);
7284
    }
7285
 
7286
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
7287
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 7288
      iprot.readStructBegin();
7289
      while (true)
7290
      {
7291
        field = iprot.readFieldBegin();
3430 rajveer 7292
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 7293
          break;
7294
        }
3430 rajveer 7295
        switch (field.id) {
7296
          case 1: // COUPON_CODE
7297
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
7298
              this.couponCode = iprot.readString();
7299
            } else { 
7300
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7301
            }
7302
            break;
7303
          default:
7304
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 7305
        }
3430 rajveer 7306
        iprot.readFieldEnd();
3385 varun.gupt 7307
      }
7308
      iprot.readStructEnd();
7309
      validate();
7310
    }
7311
 
3430 rajveer 7312
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 7313
      validate();
7314
 
7315
      oprot.writeStructBegin(STRUCT_DESC);
7316
      if (this.couponCode != null) {
7317
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
7318
        oprot.writeString(this.couponCode);
7319
        oprot.writeFieldEnd();
7320
      }
7321
      oprot.writeFieldStop();
7322
      oprot.writeStructEnd();
7323
    }
7324
 
7325
    @Override
7326
    public String toString() {
7327
      StringBuilder sb = new StringBuilder("getSuccessfulPaymentCountForCoupon_args(");
7328
      boolean first = true;
7329
 
7330
      sb.append("couponCode:");
7331
      if (this.couponCode == null) {
7332
        sb.append("null");
7333
      } else {
7334
        sb.append(this.couponCode);
7335
      }
7336
      first = false;
7337
      sb.append(")");
7338
      return sb.toString();
7339
    }
7340
 
3430 rajveer 7341
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 7342
      // check for required fields
7343
    }
7344
 
3430 rajveer 7345
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
7346
      try {
7347
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
7348
      } catch (org.apache.thrift.TException te) {
7349
        throw new java.io.IOException(te);
7350
      }
7351
    }
7352
 
7353
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
7354
      try {
7355
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
7356
      } catch (org.apache.thrift.TException te) {
7357
        throw new java.io.IOException(te);
7358
      }
7359
    }
7360
 
3385 varun.gupt 7361
  }
7362
 
3430 rajveer 7363
  public static class getSuccessfulPaymentCountForCoupon_result implements org.apache.thrift.TBase<getSuccessfulPaymentCountForCoupon_result, getSuccessfulPaymentCountForCoupon_result._Fields>, java.io.Serializable, Cloneable   {
7364
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSuccessfulPaymentCountForCoupon_result");
3385 varun.gupt 7365
 
3430 rajveer 7366
    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);
7367
    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 7368
 
3430 rajveer 7369
    private long success; // required
7370
    private PromotionException pex; // required
3385 varun.gupt 7371
 
7372
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 7373
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 7374
      SUCCESS((short)0, "success"),
7375
      PEX((short)1, "pex");
7376
 
7377
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7378
 
7379
      static {
7380
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7381
          byName.put(field.getFieldName(), field);
7382
        }
7383
      }
7384
 
7385
      /**
7386
       * Find the _Fields constant that matches fieldId, or null if its not found.
7387
       */
7388
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 7389
        switch(fieldId) {
7390
          case 0: // SUCCESS
7391
            return SUCCESS;
7392
          case 1: // PEX
7393
            return PEX;
7394
          default:
7395
            return null;
7396
        }
3385 varun.gupt 7397
      }
7398
 
7399
      /**
7400
       * Find the _Fields constant that matches fieldId, throwing an exception
7401
       * if it is not found.
7402
       */
7403
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7404
        _Fields fields = findByThriftId(fieldId);
7405
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7406
        return fields;
7407
      }
7408
 
7409
      /**
7410
       * Find the _Fields constant that matches name, or null if its not found.
7411
       */
7412
      public static _Fields findByName(String name) {
7413
        return byName.get(name);
7414
      }
7415
 
7416
      private final short _thriftId;
7417
      private final String _fieldName;
7418
 
7419
      _Fields(short thriftId, String fieldName) {
7420
        _thriftId = thriftId;
7421
        _fieldName = fieldName;
7422
      }
7423
 
7424
      public short getThriftFieldId() {
7425
        return _thriftId;
7426
      }
7427
 
7428
      public String getFieldName() {
7429
        return _fieldName;
7430
      }
7431
    }
7432
 
7433
    // isset id assignments
7434
    private static final int __SUCCESS_ISSET_ID = 0;
7435
    private BitSet __isset_bit_vector = new BitSet(1);
7436
 
3430 rajveer 7437
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 7438
    static {
3430 rajveer 7439
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
7440
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7441
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
7442
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7443
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
7444
      metaDataMap = Collections.unmodifiableMap(tmpMap);
7445
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSuccessfulPaymentCountForCoupon_result.class, metaDataMap);
3385 varun.gupt 7446
    }
7447
 
7448
    public getSuccessfulPaymentCountForCoupon_result() {
7449
    }
7450
 
7451
    public getSuccessfulPaymentCountForCoupon_result(
7452
      long success,
7453
      PromotionException pex)
7454
    {
7455
      this();
7456
      this.success = success;
7457
      setSuccessIsSet(true);
7458
      this.pex = pex;
7459
    }
7460
 
7461
    /**
7462
     * Performs a deep copy on <i>other</i>.
7463
     */
7464
    public getSuccessfulPaymentCountForCoupon_result(getSuccessfulPaymentCountForCoupon_result other) {
7465
      __isset_bit_vector.clear();
7466
      __isset_bit_vector.or(other.__isset_bit_vector);
7467
      this.success = other.success;
7468
      if (other.isSetPex()) {
7469
        this.pex = new PromotionException(other.pex);
7470
      }
7471
    }
7472
 
7473
    public getSuccessfulPaymentCountForCoupon_result deepCopy() {
7474
      return new getSuccessfulPaymentCountForCoupon_result(this);
7475
    }
7476
 
3430 rajveer 7477
    @Override
7478
    public void clear() {
7479
      setSuccessIsSet(false);
7480
      this.success = 0;
7481
      this.pex = null;
3385 varun.gupt 7482
    }
7483
 
7484
    public long getSuccess() {
7485
      return this.success;
7486
    }
7487
 
3430 rajveer 7488
    public void setSuccess(long success) {
3385 varun.gupt 7489
      this.success = success;
7490
      setSuccessIsSet(true);
7491
    }
7492
 
7493
    public void unsetSuccess() {
7494
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
7495
    }
7496
 
3430 rajveer 7497
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3385 varun.gupt 7498
    public boolean isSetSuccess() {
7499
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
7500
    }
7501
 
7502
    public void setSuccessIsSet(boolean value) {
7503
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
7504
    }
7505
 
7506
    public PromotionException getPex() {
7507
      return this.pex;
7508
    }
7509
 
3430 rajveer 7510
    public void setPex(PromotionException pex) {
3385 varun.gupt 7511
      this.pex = pex;
7512
    }
7513
 
7514
    public void unsetPex() {
7515
      this.pex = null;
7516
    }
7517
 
3430 rajveer 7518
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
3385 varun.gupt 7519
    public boolean isSetPex() {
7520
      return this.pex != null;
7521
    }
7522
 
7523
    public void setPexIsSet(boolean value) {
7524
      if (!value) {
7525
        this.pex = null;
7526
      }
7527
    }
7528
 
7529
    public void setFieldValue(_Fields field, Object value) {
7530
      switch (field) {
7531
      case SUCCESS:
7532
        if (value == null) {
7533
          unsetSuccess();
7534
        } else {
7535
          setSuccess((Long)value);
7536
        }
7537
        break;
7538
 
7539
      case PEX:
7540
        if (value == null) {
7541
          unsetPex();
7542
        } else {
7543
          setPex((PromotionException)value);
7544
        }
7545
        break;
7546
 
7547
      }
7548
    }
7549
 
7550
    public Object getFieldValue(_Fields field) {
7551
      switch (field) {
7552
      case SUCCESS:
3430 rajveer 7553
        return Long.valueOf(getSuccess());
3385 varun.gupt 7554
 
7555
      case PEX:
7556
        return getPex();
7557
 
7558
      }
7559
      throw new IllegalStateException();
7560
    }
7561
 
3430 rajveer 7562
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
7563
    public boolean isSet(_Fields field) {
7564
      if (field == null) {
7565
        throw new IllegalArgumentException();
7566
      }
3385 varun.gupt 7567
 
7568
      switch (field) {
7569
      case SUCCESS:
7570
        return isSetSuccess();
7571
      case PEX:
7572
        return isSetPex();
7573
      }
7574
      throw new IllegalStateException();
7575
    }
7576
 
7577
    @Override
7578
    public boolean equals(Object that) {
7579
      if (that == null)
7580
        return false;
7581
      if (that instanceof getSuccessfulPaymentCountForCoupon_result)
7582
        return this.equals((getSuccessfulPaymentCountForCoupon_result)that);
7583
      return false;
7584
    }
7585
 
7586
    public boolean equals(getSuccessfulPaymentCountForCoupon_result that) {
7587
      if (that == null)
7588
        return false;
7589
 
7590
      boolean this_present_success = true;
7591
      boolean that_present_success = true;
7592
      if (this_present_success || that_present_success) {
7593
        if (!(this_present_success && that_present_success))
7594
          return false;
7595
        if (this.success != that.success)
7596
          return false;
7597
      }
7598
 
7599
      boolean this_present_pex = true && this.isSetPex();
7600
      boolean that_present_pex = true && that.isSetPex();
7601
      if (this_present_pex || that_present_pex) {
7602
        if (!(this_present_pex && that_present_pex))
7603
          return false;
7604
        if (!this.pex.equals(that.pex))
7605
          return false;
7606
      }
7607
 
7608
      return true;
7609
    }
7610
 
7611
    @Override
7612
    public int hashCode() {
7613
      return 0;
7614
    }
7615
 
7616
    public int compareTo(getSuccessfulPaymentCountForCoupon_result other) {
7617
      if (!getClass().equals(other.getClass())) {
7618
        return getClass().getName().compareTo(other.getClass().getName());
7619
      }
7620
 
7621
      int lastComparison = 0;
7622
      getSuccessfulPaymentCountForCoupon_result typedOther = (getSuccessfulPaymentCountForCoupon_result)other;
7623
 
3430 rajveer 7624
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3385 varun.gupt 7625
      if (lastComparison != 0) {
7626
        return lastComparison;
7627
      }
3430 rajveer 7628
      if (isSetSuccess()) {
7629
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
7630
        if (lastComparison != 0) {
7631
          return lastComparison;
7632
        }
3385 varun.gupt 7633
      }
3430 rajveer 7634
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
3385 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
        }
3385 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;
3385 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) { 
3385 varun.gupt 7658
          break;
7659
        }
3430 rajveer 7660
        switch (field.id) {
7661
          case 0: // SUCCESS
7662
            if (field.type == org.apache.thrift.protocol.TType.I64) {
7663
              this.success = iprot.readI64();
7664
              setSuccessIsSet(true);
7665
            } else { 
7666
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7667
            }
7668
            break;
7669
          case 1: // PEX
7670
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
7671
              this.pex = new PromotionException();
7672
              this.pex.read(iprot);
7673
            } else { 
7674
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7675
            }
7676
            break;
7677
          default:
7678
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 7679
        }
3430 rajveer 7680
        iprot.readFieldEnd();
3385 varun.gupt 7681
      }
7682
      iprot.readStructEnd();
7683
      validate();
7684
    }
7685
 
3430 rajveer 7686
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 7687
      oprot.writeStructBegin(STRUCT_DESC);
7688
 
7689
      if (this.isSetSuccess()) {
7690
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
7691
        oprot.writeI64(this.success);
7692
        oprot.writeFieldEnd();
7693
      } else if (this.isSetPex()) {
7694
        oprot.writeFieldBegin(PEX_FIELD_DESC);
7695
        this.pex.write(oprot);
7696
        oprot.writeFieldEnd();
7697
      }
7698
      oprot.writeFieldStop();
7699
      oprot.writeStructEnd();
7700
    }
7701
 
7702
    @Override
7703
    public String toString() {
7704
      StringBuilder sb = new StringBuilder("getSuccessfulPaymentCountForCoupon_result(");
7705
      boolean first = true;
7706
 
7707
      sb.append("success:");
7708
      sb.append(this.success);
7709
      first = false;
7710
      if (!first) sb.append(", ");
7711
      sb.append("pex:");
7712
      if (this.pex == null) {
7713
        sb.append("null");
7714
      } else {
7715
        sb.append(this.pex);
7716
      }
7717
      first = false;
7718
      sb.append(")");
7719
      return sb.toString();
7720
    }
7721
 
3430 rajveer 7722
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 7723
      // check for required fields
7724
    }
7725
 
3430 rajveer 7726
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
7727
      try {
7728
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
7729
      } catch (org.apache.thrift.TException te) {
7730
        throw new java.io.IOException(te);
7731
      }
7732
    }
7733
 
7734
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
7735
      try {
7736
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
7737
      } catch (org.apache.thrift.TException te) {
7738
        throw new java.io.IOException(te);
7739
      }
7740
    }
7741
 
3385 varun.gupt 7742
  }
7743
 
3430 rajveer 7744
  public static class getRuleDocString_args implements org.apache.thrift.TBase<getRuleDocString_args, getRuleDocString_args._Fields>, java.io.Serializable, Cloneable   {
7745
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRuleDocString_args");
3385 varun.gupt 7746
 
3430 rajveer 7747
    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 7748
 
3430 rajveer 7749
    private String ruleName; // required
3385 varun.gupt 7750
 
7751
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 7752
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 7753
      RULE_NAME((short)1, "ruleName");
7754
 
7755
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7756
 
7757
      static {
7758
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7759
          byName.put(field.getFieldName(), field);
7760
        }
7761
      }
7762
 
7763
      /**
7764
       * Find the _Fields constant that matches fieldId, or null if its not found.
7765
       */
7766
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 7767
        switch(fieldId) {
7768
          case 1: // RULE_NAME
7769
            return RULE_NAME;
7770
          default:
7771
            return null;
7772
        }
3385 varun.gupt 7773
      }
7774
 
7775
      /**
7776
       * Find the _Fields constant that matches fieldId, throwing an exception
7777
       * if it is not found.
7778
       */
7779
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7780
        _Fields fields = findByThriftId(fieldId);
7781
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7782
        return fields;
7783
      }
7784
 
7785
      /**
7786
       * Find the _Fields constant that matches name, or null if its not found.
7787
       */
7788
      public static _Fields findByName(String name) {
7789
        return byName.get(name);
7790
      }
7791
 
7792
      private final short _thriftId;
7793
      private final String _fieldName;
7794
 
7795
      _Fields(short thriftId, String fieldName) {
7796
        _thriftId = thriftId;
7797
        _fieldName = fieldName;
7798
      }
7799
 
7800
      public short getThriftFieldId() {
7801
        return _thriftId;
7802
      }
7803
 
7804
      public String getFieldName() {
7805
        return _fieldName;
7806
      }
7807
    }
7808
 
7809
    // isset id assignments
7810
 
3430 rajveer 7811
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 7812
    static {
3430 rajveer 7813
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
7814
      tmpMap.put(_Fields.RULE_NAME, new org.apache.thrift.meta_data.FieldMetaData("ruleName", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7815
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
7816
      metaDataMap = Collections.unmodifiableMap(tmpMap);
7817
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRuleDocString_args.class, metaDataMap);
3385 varun.gupt 7818
    }
7819
 
7820
    public getRuleDocString_args() {
7821
    }
7822
 
7823
    public getRuleDocString_args(
7824
      String ruleName)
7825
    {
7826
      this();
7827
      this.ruleName = ruleName;
7828
    }
7829
 
7830
    /**
7831
     * Performs a deep copy on <i>other</i>.
7832
     */
7833
    public getRuleDocString_args(getRuleDocString_args other) {
7834
      if (other.isSetRuleName()) {
7835
        this.ruleName = other.ruleName;
7836
      }
7837
    }
7838
 
7839
    public getRuleDocString_args deepCopy() {
7840
      return new getRuleDocString_args(this);
7841
    }
7842
 
3430 rajveer 7843
    @Override
7844
    public void clear() {
7845
      this.ruleName = null;
3385 varun.gupt 7846
    }
7847
 
7848
    public String getRuleName() {
7849
      return this.ruleName;
7850
    }
7851
 
3430 rajveer 7852
    public void setRuleName(String ruleName) {
3385 varun.gupt 7853
      this.ruleName = ruleName;
7854
    }
7855
 
7856
    public void unsetRuleName() {
7857
      this.ruleName = null;
7858
    }
7859
 
3430 rajveer 7860
    /** Returns true if field ruleName is set (has been assigned a value) and false otherwise */
3385 varun.gupt 7861
    public boolean isSetRuleName() {
7862
      return this.ruleName != null;
7863
    }
7864
 
7865
    public void setRuleNameIsSet(boolean value) {
7866
      if (!value) {
7867
        this.ruleName = null;
7868
      }
7869
    }
7870
 
7871
    public void setFieldValue(_Fields field, Object value) {
7872
      switch (field) {
7873
      case RULE_NAME:
7874
        if (value == null) {
7875
          unsetRuleName();
7876
        } else {
7877
          setRuleName((String)value);
7878
        }
7879
        break;
7880
 
7881
      }
7882
    }
7883
 
7884
    public Object getFieldValue(_Fields field) {
7885
      switch (field) {
7886
      case RULE_NAME:
7887
        return getRuleName();
7888
 
7889
      }
7890
      throw new IllegalStateException();
7891
    }
7892
 
3430 rajveer 7893
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
7894
    public boolean isSet(_Fields field) {
7895
      if (field == null) {
7896
        throw new IllegalArgumentException();
7897
      }
3385 varun.gupt 7898
 
7899
      switch (field) {
7900
      case RULE_NAME:
7901
        return isSetRuleName();
7902
      }
7903
      throw new IllegalStateException();
7904
    }
7905
 
7906
    @Override
7907
    public boolean equals(Object that) {
7908
      if (that == null)
7909
        return false;
7910
      if (that instanceof getRuleDocString_args)
7911
        return this.equals((getRuleDocString_args)that);
7912
      return false;
7913
    }
7914
 
7915
    public boolean equals(getRuleDocString_args that) {
7916
      if (that == null)
7917
        return false;
7918
 
7919
      boolean this_present_ruleName = true && this.isSetRuleName();
7920
      boolean that_present_ruleName = true && that.isSetRuleName();
7921
      if (this_present_ruleName || that_present_ruleName) {
7922
        if (!(this_present_ruleName && that_present_ruleName))
7923
          return false;
7924
        if (!this.ruleName.equals(that.ruleName))
7925
          return false;
7926
      }
7927
 
7928
      return true;
7929
    }
7930
 
7931
    @Override
7932
    public int hashCode() {
7933
      return 0;
7934
    }
7935
 
7936
    public int compareTo(getRuleDocString_args other) {
7937
      if (!getClass().equals(other.getClass())) {
7938
        return getClass().getName().compareTo(other.getClass().getName());
7939
      }
7940
 
7941
      int lastComparison = 0;
7942
      getRuleDocString_args typedOther = (getRuleDocString_args)other;
7943
 
3430 rajveer 7944
      lastComparison = Boolean.valueOf(isSetRuleName()).compareTo(typedOther.isSetRuleName());
3385 varun.gupt 7945
      if (lastComparison != 0) {
7946
        return lastComparison;
7947
      }
3430 rajveer 7948
      if (isSetRuleName()) {
7949
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ruleName, typedOther.ruleName);
7950
        if (lastComparison != 0) {
7951
          return lastComparison;
7952
        }
3385 varun.gupt 7953
      }
7954
      return 0;
7955
    }
7956
 
3430 rajveer 7957
    public _Fields fieldForId(int fieldId) {
7958
      return _Fields.findByThriftId(fieldId);
7959
    }
7960
 
7961
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
7962
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 7963
      iprot.readStructBegin();
7964
      while (true)
7965
      {
7966
        field = iprot.readFieldBegin();
3430 rajveer 7967
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 7968
          break;
7969
        }
3430 rajveer 7970
        switch (field.id) {
7971
          case 1: // RULE_NAME
7972
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
7973
              this.ruleName = iprot.readString();
7974
            } else { 
7975
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7976
            }
7977
            break;
7978
          default:
7979
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 7980
        }
3430 rajveer 7981
        iprot.readFieldEnd();
3385 varun.gupt 7982
      }
7983
      iprot.readStructEnd();
7984
      validate();
7985
    }
7986
 
3430 rajveer 7987
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 7988
      validate();
7989
 
7990
      oprot.writeStructBegin(STRUCT_DESC);
7991
      if (this.ruleName != null) {
7992
        oprot.writeFieldBegin(RULE_NAME_FIELD_DESC);
7993
        oprot.writeString(this.ruleName);
7994
        oprot.writeFieldEnd();
7995
      }
7996
      oprot.writeFieldStop();
7997
      oprot.writeStructEnd();
7998
    }
7999
 
8000
    @Override
8001
    public String toString() {
8002
      StringBuilder sb = new StringBuilder("getRuleDocString_args(");
8003
      boolean first = true;
8004
 
8005
      sb.append("ruleName:");
8006
      if (this.ruleName == null) {
8007
        sb.append("null");
8008
      } else {
8009
        sb.append(this.ruleName);
8010
      }
8011
      first = false;
8012
      sb.append(")");
8013
      return sb.toString();
8014
    }
8015
 
3430 rajveer 8016
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 8017
      // check for required fields
8018
    }
8019
 
3430 rajveer 8020
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
8021
      try {
8022
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
8023
      } catch (org.apache.thrift.TException te) {
8024
        throw new java.io.IOException(te);
8025
      }
8026
    }
8027
 
8028
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
8029
      try {
8030
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
8031
      } catch (org.apache.thrift.TException te) {
8032
        throw new java.io.IOException(te);
8033
      }
8034
    }
8035
 
3385 varun.gupt 8036
  }
8037
 
3430 rajveer 8038
  public static class getRuleDocString_result implements org.apache.thrift.TBase<getRuleDocString_result, getRuleDocString_result._Fields>, java.io.Serializable, Cloneable   {
8039
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRuleDocString_result");
3385 varun.gupt 8040
 
3430 rajveer 8041
    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 8042
 
3430 rajveer 8043
    private String success; // required
3385 varun.gupt 8044
 
8045
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 8046
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 8047
      SUCCESS((short)0, "success");
8048
 
8049
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8050
 
8051
      static {
8052
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8053
          byName.put(field.getFieldName(), field);
8054
        }
8055
      }
8056
 
8057
      /**
8058
       * Find the _Fields constant that matches fieldId, or null if its not found.
8059
       */
8060
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 8061
        switch(fieldId) {
8062
          case 0: // SUCCESS
8063
            return SUCCESS;
8064
          default:
8065
            return null;
8066
        }
3385 varun.gupt 8067
      }
8068
 
8069
      /**
8070
       * Find the _Fields constant that matches fieldId, throwing an exception
8071
       * if it is not found.
8072
       */
8073
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8074
        _Fields fields = findByThriftId(fieldId);
8075
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8076
        return fields;
8077
      }
8078
 
8079
      /**
8080
       * Find the _Fields constant that matches name, or null if its not found.
8081
       */
8082
      public static _Fields findByName(String name) {
8083
        return byName.get(name);
8084
      }
8085
 
8086
      private final short _thriftId;
8087
      private final String _fieldName;
8088
 
8089
      _Fields(short thriftId, String fieldName) {
8090
        _thriftId = thriftId;
8091
        _fieldName = fieldName;
8092
      }
8093
 
8094
      public short getThriftFieldId() {
8095
        return _thriftId;
8096
      }
8097
 
8098
      public String getFieldName() {
8099
        return _fieldName;
8100
      }
8101
    }
8102
 
8103
    // isset id assignments
8104
 
3430 rajveer 8105
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 8106
    static {
3430 rajveer 8107
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
8108
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8109
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
8110
      metaDataMap = Collections.unmodifiableMap(tmpMap);
8111
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRuleDocString_result.class, metaDataMap);
3385 varun.gupt 8112
    }
8113
 
8114
    public getRuleDocString_result() {
8115
    }
8116
 
8117
    public getRuleDocString_result(
8118
      String success)
8119
    {
8120
      this();
8121
      this.success = success;
8122
    }
8123
 
8124
    /**
8125
     * Performs a deep copy on <i>other</i>.
8126
     */
8127
    public getRuleDocString_result(getRuleDocString_result other) {
8128
      if (other.isSetSuccess()) {
8129
        this.success = other.success;
8130
      }
8131
    }
8132
 
8133
    public getRuleDocString_result deepCopy() {
8134
      return new getRuleDocString_result(this);
8135
    }
8136
 
3430 rajveer 8137
    @Override
8138
    public void clear() {
8139
      this.success = null;
3385 varun.gupt 8140
    }
8141
 
8142
    public String getSuccess() {
8143
      return this.success;
8144
    }
8145
 
3430 rajveer 8146
    public void setSuccess(String success) {
3385 varun.gupt 8147
      this.success = success;
8148
    }
8149
 
8150
    public void unsetSuccess() {
8151
      this.success = null;
8152
    }
8153
 
3430 rajveer 8154
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3385 varun.gupt 8155
    public boolean isSetSuccess() {
8156
      return this.success != null;
8157
    }
8158
 
8159
    public void setSuccessIsSet(boolean value) {
8160
      if (!value) {
8161
        this.success = null;
8162
      }
8163
    }
8164
 
8165
    public void setFieldValue(_Fields field, Object value) {
8166
      switch (field) {
8167
      case SUCCESS:
8168
        if (value == null) {
8169
          unsetSuccess();
8170
        } else {
8171
          setSuccess((String)value);
8172
        }
8173
        break;
8174
 
8175
      }
8176
    }
8177
 
8178
    public Object getFieldValue(_Fields field) {
8179
      switch (field) {
8180
      case SUCCESS:
8181
        return getSuccess();
8182
 
8183
      }
8184
      throw new IllegalStateException();
8185
    }
8186
 
3430 rajveer 8187
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
8188
    public boolean isSet(_Fields field) {
8189
      if (field == null) {
8190
        throw new IllegalArgumentException();
8191
      }
3385 varun.gupt 8192
 
8193
      switch (field) {
8194
      case SUCCESS:
8195
        return isSetSuccess();
8196
      }
8197
      throw new IllegalStateException();
8198
    }
8199
 
8200
    @Override
8201
    public boolean equals(Object that) {
8202
      if (that == null)
8203
        return false;
8204
      if (that instanceof getRuleDocString_result)
8205
        return this.equals((getRuleDocString_result)that);
8206
      return false;
8207
    }
8208
 
8209
    public boolean equals(getRuleDocString_result that) {
8210
      if (that == null)
8211
        return false;
8212
 
8213
      boolean this_present_success = true && this.isSetSuccess();
8214
      boolean that_present_success = true && that.isSetSuccess();
8215
      if (this_present_success || that_present_success) {
8216
        if (!(this_present_success && that_present_success))
8217
          return false;
8218
        if (!this.success.equals(that.success))
8219
          return false;
8220
      }
8221
 
8222
      return true;
8223
    }
8224
 
8225
    @Override
8226
    public int hashCode() {
8227
      return 0;
8228
    }
8229
 
8230
    public int compareTo(getRuleDocString_result other) {
8231
      if (!getClass().equals(other.getClass())) {
8232
        return getClass().getName().compareTo(other.getClass().getName());
8233
      }
8234
 
8235
      int lastComparison = 0;
8236
      getRuleDocString_result typedOther = (getRuleDocString_result)other;
8237
 
3430 rajveer 8238
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3385 varun.gupt 8239
      if (lastComparison != 0) {
8240
        return lastComparison;
8241
      }
3430 rajveer 8242
      if (isSetSuccess()) {
8243
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
8244
        if (lastComparison != 0) {
8245
          return lastComparison;
8246
        }
3385 varun.gupt 8247
      }
8248
      return 0;
8249
    }
8250
 
3430 rajveer 8251
    public _Fields fieldForId(int fieldId) {
8252
      return _Fields.findByThriftId(fieldId);
8253
    }
8254
 
8255
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
8256
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 8257
      iprot.readStructBegin();
8258
      while (true)
8259
      {
8260
        field = iprot.readFieldBegin();
3430 rajveer 8261
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 8262
          break;
8263
        }
3430 rajveer 8264
        switch (field.id) {
8265
          case 0: // SUCCESS
8266
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
8267
              this.success = iprot.readString();
8268
            } else { 
8269
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8270
            }
8271
            break;
8272
          default:
8273
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 8274
        }
3430 rajveer 8275
        iprot.readFieldEnd();
3385 varun.gupt 8276
      }
8277
      iprot.readStructEnd();
8278
      validate();
8279
    }
8280
 
3430 rajveer 8281
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 8282
      oprot.writeStructBegin(STRUCT_DESC);
8283
 
8284
      if (this.isSetSuccess()) {
8285
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
8286
        oprot.writeString(this.success);
8287
        oprot.writeFieldEnd();
8288
      }
8289
      oprot.writeFieldStop();
8290
      oprot.writeStructEnd();
8291
    }
8292
 
8293
    @Override
8294
    public String toString() {
8295
      StringBuilder sb = new StringBuilder("getRuleDocString_result(");
8296
      boolean first = true;
8297
 
8298
      sb.append("success:");
8299
      if (this.success == null) {
8300
        sb.append("null");
8301
      } else {
8302
        sb.append(this.success);
8303
      }
8304
      first = false;
8305
      sb.append(")");
8306
      return sb.toString();
8307
    }
8308
 
3430 rajveer 8309
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 8310
      // check for required fields
8311
    }
8312
 
3430 rajveer 8313
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
8314
      try {
8315
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
8316
      } catch (org.apache.thrift.TException te) {
8317
        throw new java.io.IOException(te);
8318
      }
8319
    }
8320
 
8321
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
8322
      try {
8323
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
8324
      } catch (org.apache.thrift.TException te) {
8325
        throw new java.io.IOException(te);
8326
      }
8327
    }
8328
 
3385 varun.gupt 8329
  }
8330
 
4189 varun.gupt 8331
  public static class getItemDiscountMap_args implements org.apache.thrift.TBase<getItemDiscountMap_args, getItemDiscountMap_args._Fields>, java.io.Serializable, Cloneable   {
8332
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemDiscountMap_args");
8333
 
8334
    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);
8335
 
8336
    private List<Long> itemIds; // required
8337
 
8338
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
8339
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
8340
      ITEM_IDS((short)1, "itemIds");
8341
 
8342
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8343
 
8344
      static {
8345
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8346
          byName.put(field.getFieldName(), field);
8347
        }
8348
      }
8349
 
8350
      /**
8351
       * Find the _Fields constant that matches fieldId, or null if its not found.
8352
       */
8353
      public static _Fields findByThriftId(int fieldId) {
8354
        switch(fieldId) {
8355
          case 1: // ITEM_IDS
8356
            return ITEM_IDS;
8357
          default:
8358
            return null;
8359
        }
8360
      }
8361
 
8362
      /**
8363
       * Find the _Fields constant that matches fieldId, throwing an exception
8364
       * if it is not found.
8365
       */
8366
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8367
        _Fields fields = findByThriftId(fieldId);
8368
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8369
        return fields;
8370
      }
8371
 
8372
      /**
8373
       * Find the _Fields constant that matches name, or null if its not found.
8374
       */
8375
      public static _Fields findByName(String name) {
8376
        return byName.get(name);
8377
      }
8378
 
8379
      private final short _thriftId;
8380
      private final String _fieldName;
8381
 
8382
      _Fields(short thriftId, String fieldName) {
8383
        _thriftId = thriftId;
8384
        _fieldName = fieldName;
8385
      }
8386
 
8387
      public short getThriftFieldId() {
8388
        return _thriftId;
8389
      }
8390
 
8391
      public String getFieldName() {
8392
        return _fieldName;
8393
      }
8394
    }
8395
 
8396
    // isset id assignments
8397
 
8398
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
8399
    static {
8400
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
8401
      tmpMap.put(_Fields.ITEM_IDS, new org.apache.thrift.meta_data.FieldMetaData("itemIds", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8402
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
8403
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))));
8404
      metaDataMap = Collections.unmodifiableMap(tmpMap);
8405
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getItemDiscountMap_args.class, metaDataMap);
8406
    }
8407
 
8408
    public getItemDiscountMap_args() {
8409
    }
8410
 
8411
    public getItemDiscountMap_args(
8412
      List<Long> itemIds)
8413
    {
8414
      this();
8415
      this.itemIds = itemIds;
8416
    }
8417
 
8418
    /**
8419
     * Performs a deep copy on <i>other</i>.
8420
     */
8421
    public getItemDiscountMap_args(getItemDiscountMap_args other) {
8422
      if (other.isSetItemIds()) {
8423
        List<Long> __this__itemIds = new ArrayList<Long>();
8424
        for (Long other_element : other.itemIds) {
8425
          __this__itemIds.add(other_element);
8426
        }
8427
        this.itemIds = __this__itemIds;
8428
      }
8429
    }
8430
 
8431
    public getItemDiscountMap_args deepCopy() {
8432
      return new getItemDiscountMap_args(this);
8433
    }
8434
 
8435
    @Override
8436
    public void clear() {
8437
      this.itemIds = null;
8438
    }
8439
 
8440
    public int getItemIdsSize() {
8441
      return (this.itemIds == null) ? 0 : this.itemIds.size();
8442
    }
8443
 
8444
    public java.util.Iterator<Long> getItemIdsIterator() {
8445
      return (this.itemIds == null) ? null : this.itemIds.iterator();
8446
    }
8447
 
8448
    public void addToItemIds(long elem) {
8449
      if (this.itemIds == null) {
8450
        this.itemIds = new ArrayList<Long>();
8451
      }
8452
      this.itemIds.add(elem);
8453
    }
8454
 
8455
    public List<Long> getItemIds() {
8456
      return this.itemIds;
8457
    }
8458
 
8459
    public void setItemIds(List<Long> itemIds) {
8460
      this.itemIds = itemIds;
8461
    }
8462
 
8463
    public void unsetItemIds() {
8464
      this.itemIds = null;
8465
    }
8466
 
8467
    /** Returns true if field itemIds is set (has been assigned a value) and false otherwise */
8468
    public boolean isSetItemIds() {
8469
      return this.itemIds != null;
8470
    }
8471
 
8472
    public void setItemIdsIsSet(boolean value) {
8473
      if (!value) {
8474
        this.itemIds = null;
8475
      }
8476
    }
8477
 
8478
    public void setFieldValue(_Fields field, Object value) {
8479
      switch (field) {
8480
      case ITEM_IDS:
8481
        if (value == null) {
8482
          unsetItemIds();
8483
        } else {
8484
          setItemIds((List<Long>)value);
8485
        }
8486
        break;
8487
 
8488
      }
8489
    }
8490
 
8491
    public Object getFieldValue(_Fields field) {
8492
      switch (field) {
8493
      case ITEM_IDS:
8494
        return getItemIds();
8495
 
8496
      }
8497
      throw new IllegalStateException();
8498
    }
8499
 
8500
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
8501
    public boolean isSet(_Fields field) {
8502
      if (field == null) {
8503
        throw new IllegalArgumentException();
8504
      }
8505
 
8506
      switch (field) {
8507
      case ITEM_IDS:
8508
        return isSetItemIds();
8509
      }
8510
      throw new IllegalStateException();
8511
    }
8512
 
8513
    @Override
8514
    public boolean equals(Object that) {
8515
      if (that == null)
8516
        return false;
8517
      if (that instanceof getItemDiscountMap_args)
8518
        return this.equals((getItemDiscountMap_args)that);
8519
      return false;
8520
    }
8521
 
8522
    public boolean equals(getItemDiscountMap_args that) {
8523
      if (that == null)
8524
        return false;
8525
 
8526
      boolean this_present_itemIds = true && this.isSetItemIds();
8527
      boolean that_present_itemIds = true && that.isSetItemIds();
8528
      if (this_present_itemIds || that_present_itemIds) {
8529
        if (!(this_present_itemIds && that_present_itemIds))
8530
          return false;
8531
        if (!this.itemIds.equals(that.itemIds))
8532
          return false;
8533
      }
8534
 
8535
      return true;
8536
    }
8537
 
8538
    @Override
8539
    public int hashCode() {
8540
      return 0;
8541
    }
8542
 
8543
    public int compareTo(getItemDiscountMap_args other) {
8544
      if (!getClass().equals(other.getClass())) {
8545
        return getClass().getName().compareTo(other.getClass().getName());
8546
      }
8547
 
8548
      int lastComparison = 0;
8549
      getItemDiscountMap_args typedOther = (getItemDiscountMap_args)other;
8550
 
8551
      lastComparison = Boolean.valueOf(isSetItemIds()).compareTo(typedOther.isSetItemIds());
8552
      if (lastComparison != 0) {
8553
        return lastComparison;
8554
      }
8555
      if (isSetItemIds()) {
8556
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.itemIds, typedOther.itemIds);
8557
        if (lastComparison != 0) {
8558
          return lastComparison;
8559
        }
8560
      }
8561
      return 0;
8562
    }
8563
 
8564
    public _Fields fieldForId(int fieldId) {
8565
      return _Fields.findByThriftId(fieldId);
8566
    }
8567
 
8568
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
8569
      org.apache.thrift.protocol.TField field;
8570
      iprot.readStructBegin();
8571
      while (true)
8572
      {
8573
        field = iprot.readFieldBegin();
8574
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
8575
          break;
8576
        }
8577
        switch (field.id) {
8578
          case 1: // ITEM_IDS
8579
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
8580
              {
5327 rajveer 8581
                org.apache.thrift.protocol.TList _list20 = iprot.readListBegin();
8582
                this.itemIds = new ArrayList<Long>(_list20.size);
8583
                for (int _i21 = 0; _i21 < _list20.size; ++_i21)
4189 varun.gupt 8584
                {
5327 rajveer 8585
                  long _elem22; // required
8586
                  _elem22 = iprot.readI64();
8587
                  this.itemIds.add(_elem22);
4189 varun.gupt 8588
                }
8589
                iprot.readListEnd();
8590
              }
8591
            } else { 
8592
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8593
            }
8594
            break;
8595
          default:
8596
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8597
        }
8598
        iprot.readFieldEnd();
8599
      }
8600
      iprot.readStructEnd();
8601
      validate();
8602
    }
8603
 
8604
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
8605
      validate();
8606
 
8607
      oprot.writeStructBegin(STRUCT_DESC);
8608
      if (this.itemIds != null) {
8609
        oprot.writeFieldBegin(ITEM_IDS_FIELD_DESC);
8610
        {
8611
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, this.itemIds.size()));
5327 rajveer 8612
          for (long _iter23 : this.itemIds)
4189 varun.gupt 8613
          {
5327 rajveer 8614
            oprot.writeI64(_iter23);
4189 varun.gupt 8615
          }
8616
          oprot.writeListEnd();
8617
        }
8618
        oprot.writeFieldEnd();
8619
      }
8620
      oprot.writeFieldStop();
8621
      oprot.writeStructEnd();
8622
    }
8623
 
8624
    @Override
8625
    public String toString() {
8626
      StringBuilder sb = new StringBuilder("getItemDiscountMap_args(");
8627
      boolean first = true;
8628
 
8629
      sb.append("itemIds:");
8630
      if (this.itemIds == null) {
8631
        sb.append("null");
8632
      } else {
8633
        sb.append(this.itemIds);
8634
      }
8635
      first = false;
8636
      sb.append(")");
8637
      return sb.toString();
8638
    }
8639
 
8640
    public void validate() throws org.apache.thrift.TException {
8641
      // check for required fields
8642
    }
8643
 
8644
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
8645
      try {
8646
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
8647
      } catch (org.apache.thrift.TException te) {
8648
        throw new java.io.IOException(te);
8649
      }
8650
    }
8651
 
8652
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
8653
      try {
8654
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
8655
      } catch (org.apache.thrift.TException te) {
8656
        throw new java.io.IOException(te);
8657
      }
8658
    }
8659
 
8660
  }
8661
 
8662
  public static class getItemDiscountMap_result implements org.apache.thrift.TBase<getItemDiscountMap_result, getItemDiscountMap_result._Fields>, java.io.Serializable, Cloneable   {
8663
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemDiscountMap_result");
8664
 
8665
    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);
8666
    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);
8667
 
8668
    private List<ItemCouponDiscount> success; // required
8669
    private PromotionException pex; // required
8670
 
8671
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
8672
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
8673
      SUCCESS((short)0, "success"),
8674
      PEX((short)1, "pex");
8675
 
8676
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8677
 
8678
      static {
8679
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8680
          byName.put(field.getFieldName(), field);
8681
        }
8682
      }
8683
 
8684
      /**
8685
       * Find the _Fields constant that matches fieldId, or null if its not found.
8686
       */
8687
      public static _Fields findByThriftId(int fieldId) {
8688
        switch(fieldId) {
8689
          case 0: // SUCCESS
8690
            return SUCCESS;
8691
          case 1: // PEX
8692
            return PEX;
8693
          default:
8694
            return null;
8695
        }
8696
      }
8697
 
8698
      /**
8699
       * Find the _Fields constant that matches fieldId, throwing an exception
8700
       * if it is not found.
8701
       */
8702
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8703
        _Fields fields = findByThriftId(fieldId);
8704
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8705
        return fields;
8706
      }
8707
 
8708
      /**
8709
       * Find the _Fields constant that matches name, or null if its not found.
8710
       */
8711
      public static _Fields findByName(String name) {
8712
        return byName.get(name);
8713
      }
8714
 
8715
      private final short _thriftId;
8716
      private final String _fieldName;
8717
 
8718
      _Fields(short thriftId, String fieldName) {
8719
        _thriftId = thriftId;
8720
        _fieldName = fieldName;
8721
      }
8722
 
8723
      public short getThriftFieldId() {
8724
        return _thriftId;
8725
      }
8726
 
8727
      public String getFieldName() {
8728
        return _fieldName;
8729
      }
8730
    }
8731
 
8732
    // isset id assignments
8733
 
8734
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
8735
    static {
8736
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
8737
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8738
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
8739
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ItemCouponDiscount.class))));
8740
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8741
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
8742
      metaDataMap = Collections.unmodifiableMap(tmpMap);
8743
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getItemDiscountMap_result.class, metaDataMap);
8744
    }
8745
 
8746
    public getItemDiscountMap_result() {
8747
    }
8748
 
8749
    public getItemDiscountMap_result(
8750
      List<ItemCouponDiscount> success,
8751
      PromotionException pex)
8752
    {
8753
      this();
8754
      this.success = success;
8755
      this.pex = pex;
8756
    }
8757
 
8758
    /**
8759
     * Performs a deep copy on <i>other</i>.
8760
     */
8761
    public getItemDiscountMap_result(getItemDiscountMap_result other) {
8762
      if (other.isSetSuccess()) {
8763
        List<ItemCouponDiscount> __this__success = new ArrayList<ItemCouponDiscount>();
8764
        for (ItemCouponDiscount other_element : other.success) {
8765
          __this__success.add(new ItemCouponDiscount(other_element));
8766
        }
8767
        this.success = __this__success;
8768
      }
8769
      if (other.isSetPex()) {
8770
        this.pex = new PromotionException(other.pex);
8771
      }
8772
    }
8773
 
8774
    public getItemDiscountMap_result deepCopy() {
8775
      return new getItemDiscountMap_result(this);
8776
    }
8777
 
8778
    @Override
8779
    public void clear() {
8780
      this.success = null;
8781
      this.pex = null;
8782
    }
8783
 
8784
    public int getSuccessSize() {
8785
      return (this.success == null) ? 0 : this.success.size();
8786
    }
8787
 
8788
    public java.util.Iterator<ItemCouponDiscount> getSuccessIterator() {
8789
      return (this.success == null) ? null : this.success.iterator();
8790
    }
8791
 
8792
    public void addToSuccess(ItemCouponDiscount elem) {
8793
      if (this.success == null) {
8794
        this.success = new ArrayList<ItemCouponDiscount>();
8795
      }
8796
      this.success.add(elem);
8797
    }
8798
 
8799
    public List<ItemCouponDiscount> getSuccess() {
8800
      return this.success;
8801
    }
8802
 
8803
    public void setSuccess(List<ItemCouponDiscount> success) {
8804
      this.success = success;
8805
    }
8806
 
8807
    public void unsetSuccess() {
8808
      this.success = null;
8809
    }
8810
 
8811
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
8812
    public boolean isSetSuccess() {
8813
      return this.success != null;
8814
    }
8815
 
8816
    public void setSuccessIsSet(boolean value) {
8817
      if (!value) {
8818
        this.success = null;
8819
      }
8820
    }
8821
 
8822
    public PromotionException getPex() {
8823
      return this.pex;
8824
    }
8825
 
8826
    public void setPex(PromotionException pex) {
8827
      this.pex = pex;
8828
    }
8829
 
8830
    public void unsetPex() {
8831
      this.pex = null;
8832
    }
8833
 
8834
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
8835
    public boolean isSetPex() {
8836
      return this.pex != null;
8837
    }
8838
 
8839
    public void setPexIsSet(boolean value) {
8840
      if (!value) {
8841
        this.pex = null;
8842
      }
8843
    }
8844
 
8845
    public void setFieldValue(_Fields field, Object value) {
8846
      switch (field) {
8847
      case SUCCESS:
8848
        if (value == null) {
8849
          unsetSuccess();
8850
        } else {
8851
          setSuccess((List<ItemCouponDiscount>)value);
8852
        }
8853
        break;
8854
 
8855
      case PEX:
8856
        if (value == null) {
8857
          unsetPex();
8858
        } else {
8859
          setPex((PromotionException)value);
8860
        }
8861
        break;
8862
 
8863
      }
8864
    }
8865
 
8866
    public Object getFieldValue(_Fields field) {
8867
      switch (field) {
8868
      case SUCCESS:
8869
        return getSuccess();
8870
 
8871
      case PEX:
8872
        return getPex();
8873
 
8874
      }
8875
      throw new IllegalStateException();
8876
    }
8877
 
8878
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
8879
    public boolean isSet(_Fields field) {
8880
      if (field == null) {
8881
        throw new IllegalArgumentException();
8882
      }
8883
 
8884
      switch (field) {
8885
      case SUCCESS:
8886
        return isSetSuccess();
8887
      case PEX:
8888
        return isSetPex();
8889
      }
8890
      throw new IllegalStateException();
8891
    }
8892
 
8893
    @Override
8894
    public boolean equals(Object that) {
8895
      if (that == null)
8896
        return false;
8897
      if (that instanceof getItemDiscountMap_result)
8898
        return this.equals((getItemDiscountMap_result)that);
8899
      return false;
8900
    }
8901
 
8902
    public boolean equals(getItemDiscountMap_result that) {
8903
      if (that == null)
8904
        return false;
8905
 
8906
      boolean this_present_success = true && this.isSetSuccess();
8907
      boolean that_present_success = true && that.isSetSuccess();
8908
      if (this_present_success || that_present_success) {
8909
        if (!(this_present_success && that_present_success))
8910
          return false;
8911
        if (!this.success.equals(that.success))
8912
          return false;
8913
      }
8914
 
8915
      boolean this_present_pex = true && this.isSetPex();
8916
      boolean that_present_pex = true && that.isSetPex();
8917
      if (this_present_pex || that_present_pex) {
8918
        if (!(this_present_pex && that_present_pex))
8919
          return false;
8920
        if (!this.pex.equals(that.pex))
8921
          return false;
8922
      }
8923
 
8924
      return true;
8925
    }
8926
 
8927
    @Override
8928
    public int hashCode() {
8929
      return 0;
8930
    }
8931
 
8932
    public int compareTo(getItemDiscountMap_result other) {
8933
      if (!getClass().equals(other.getClass())) {
8934
        return getClass().getName().compareTo(other.getClass().getName());
8935
      }
8936
 
8937
      int lastComparison = 0;
8938
      getItemDiscountMap_result typedOther = (getItemDiscountMap_result)other;
8939
 
8940
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
8941
      if (lastComparison != 0) {
8942
        return lastComparison;
8943
      }
8944
      if (isSetSuccess()) {
8945
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
8946
        if (lastComparison != 0) {
8947
          return lastComparison;
8948
        }
8949
      }
8950
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
8951
      if (lastComparison != 0) {
8952
        return lastComparison;
8953
      }
8954
      if (isSetPex()) {
8955
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
8956
        if (lastComparison != 0) {
8957
          return lastComparison;
8958
        }
8959
      }
8960
      return 0;
8961
    }
8962
 
8963
    public _Fields fieldForId(int fieldId) {
8964
      return _Fields.findByThriftId(fieldId);
8965
    }
8966
 
8967
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
8968
      org.apache.thrift.protocol.TField field;
8969
      iprot.readStructBegin();
8970
      while (true)
8971
      {
8972
        field = iprot.readFieldBegin();
8973
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
8974
          break;
8975
        }
8976
        switch (field.id) {
8977
          case 0: // SUCCESS
8978
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
8979
              {
5327 rajveer 8980
                org.apache.thrift.protocol.TList _list24 = iprot.readListBegin();
8981
                this.success = new ArrayList<ItemCouponDiscount>(_list24.size);
8982
                for (int _i25 = 0; _i25 < _list24.size; ++_i25)
4189 varun.gupt 8983
                {
5327 rajveer 8984
                  ItemCouponDiscount _elem26; // required
8985
                  _elem26 = new ItemCouponDiscount();
8986
                  _elem26.read(iprot);
8987
                  this.success.add(_elem26);
4189 varun.gupt 8988
                }
8989
                iprot.readListEnd();
8990
              }
8991
            } else { 
8992
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8993
            }
8994
            break;
8995
          case 1: // PEX
8996
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
8997
              this.pex = new PromotionException();
8998
              this.pex.read(iprot);
8999
            } else { 
9000
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9001
            }
9002
            break;
9003
          default:
9004
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9005
        }
9006
        iprot.readFieldEnd();
9007
      }
9008
      iprot.readStructEnd();
9009
      validate();
9010
    }
9011
 
9012
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
9013
      oprot.writeStructBegin(STRUCT_DESC);
9014
 
9015
      if (this.isSetSuccess()) {
9016
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
9017
        {
9018
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
5327 rajveer 9019
          for (ItemCouponDiscount _iter27 : this.success)
4189 varun.gupt 9020
          {
5327 rajveer 9021
            _iter27.write(oprot);
4189 varun.gupt 9022
          }
9023
          oprot.writeListEnd();
9024
        }
9025
        oprot.writeFieldEnd();
9026
      } else if (this.isSetPex()) {
9027
        oprot.writeFieldBegin(PEX_FIELD_DESC);
9028
        this.pex.write(oprot);
9029
        oprot.writeFieldEnd();
9030
      }
9031
      oprot.writeFieldStop();
9032
      oprot.writeStructEnd();
9033
    }
9034
 
9035
    @Override
9036
    public String toString() {
9037
      StringBuilder sb = new StringBuilder("getItemDiscountMap_result(");
9038
      boolean first = true;
9039
 
9040
      sb.append("success:");
9041
      if (this.success == null) {
9042
        sb.append("null");
9043
      } else {
9044
        sb.append(this.success);
9045
      }
9046
      first = false;
9047
      if (!first) sb.append(", ");
9048
      sb.append("pex:");
9049
      if (this.pex == null) {
9050
        sb.append("null");
9051
      } else {
9052
        sb.append(this.pex);
9053
      }
9054
      first = false;
9055
      sb.append(")");
9056
      return sb.toString();
9057
    }
9058
 
9059
    public void validate() throws org.apache.thrift.TException {
9060
      // check for required fields
9061
    }
9062
 
9063
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
9064
      try {
9065
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
9066
      } catch (org.apache.thrift.TException te) {
9067
        throw new java.io.IOException(te);
9068
      }
9069
    }
9070
 
9071
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
9072
      try {
9073
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
9074
      } catch (org.apache.thrift.TException te) {
9075
        throw new java.io.IOException(te);
9076
      }
9077
    }
9078
 
9079
  }
9080
 
4494 varun.gupt 9081
  public static class getDiscountsForEntity_args implements org.apache.thrift.TBase<getDiscountsForEntity_args, getDiscountsForEntity_args._Fields>, java.io.Serializable, Cloneable   {
9082
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getDiscountsForEntity_args");
9083
 
9084
    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);
9085
 
9086
    private long entityId; // required
9087
 
9088
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
9089
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
9090
      ENTITY_ID((short)1, "entityId");
9091
 
9092
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
9093
 
9094
      static {
9095
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
9096
          byName.put(field.getFieldName(), field);
9097
        }
9098
      }
9099
 
9100
      /**
9101
       * Find the _Fields constant that matches fieldId, or null if its not found.
9102
       */
9103
      public static _Fields findByThriftId(int fieldId) {
9104
        switch(fieldId) {
9105
          case 1: // ENTITY_ID
9106
            return ENTITY_ID;
9107
          default:
9108
            return null;
9109
        }
9110
      }
9111
 
9112
      /**
9113
       * Find the _Fields constant that matches fieldId, throwing an exception
9114
       * if it is not found.
9115
       */
9116
      public static _Fields findByThriftIdOrThrow(int fieldId) {
9117
        _Fields fields = findByThriftId(fieldId);
9118
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
9119
        return fields;
9120
      }
9121
 
9122
      /**
9123
       * Find the _Fields constant that matches name, or null if its not found.
9124
       */
9125
      public static _Fields findByName(String name) {
9126
        return byName.get(name);
9127
      }
9128
 
9129
      private final short _thriftId;
9130
      private final String _fieldName;
9131
 
9132
      _Fields(short thriftId, String fieldName) {
9133
        _thriftId = thriftId;
9134
        _fieldName = fieldName;
9135
      }
9136
 
9137
      public short getThriftFieldId() {
9138
        return _thriftId;
9139
      }
9140
 
9141
      public String getFieldName() {
9142
        return _fieldName;
9143
      }
9144
    }
9145
 
9146
    // isset id assignments
9147
    private static final int __ENTITYID_ISSET_ID = 0;
9148
    private BitSet __isset_bit_vector = new BitSet(1);
9149
 
9150
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
9151
    static {
9152
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
9153
      tmpMap.put(_Fields.ENTITY_ID, new org.apache.thrift.meta_data.FieldMetaData("entityId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9154
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
9155
      metaDataMap = Collections.unmodifiableMap(tmpMap);
9156
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getDiscountsForEntity_args.class, metaDataMap);
9157
    }
9158
 
9159
    public getDiscountsForEntity_args() {
9160
    }
9161
 
9162
    public getDiscountsForEntity_args(
9163
      long entityId)
9164
    {
9165
      this();
9166
      this.entityId = entityId;
9167
      setEntityIdIsSet(true);
9168
    }
9169
 
9170
    /**
9171
     * Performs a deep copy on <i>other</i>.
9172
     */
9173
    public getDiscountsForEntity_args(getDiscountsForEntity_args other) {
9174
      __isset_bit_vector.clear();
9175
      __isset_bit_vector.or(other.__isset_bit_vector);
9176
      this.entityId = other.entityId;
9177
    }
9178
 
9179
    public getDiscountsForEntity_args deepCopy() {
9180
      return new getDiscountsForEntity_args(this);
9181
    }
9182
 
9183
    @Override
9184
    public void clear() {
9185
      setEntityIdIsSet(false);
9186
      this.entityId = 0;
9187
    }
9188
 
9189
    public long getEntityId() {
9190
      return this.entityId;
9191
    }
9192
 
9193
    public void setEntityId(long entityId) {
9194
      this.entityId = entityId;
9195
      setEntityIdIsSet(true);
9196
    }
9197
 
9198
    public void unsetEntityId() {
9199
      __isset_bit_vector.clear(__ENTITYID_ISSET_ID);
9200
    }
9201
 
9202
    /** Returns true if field entityId is set (has been assigned a value) and false otherwise */
9203
    public boolean isSetEntityId() {
9204
      return __isset_bit_vector.get(__ENTITYID_ISSET_ID);
9205
    }
9206
 
9207
    public void setEntityIdIsSet(boolean value) {
9208
      __isset_bit_vector.set(__ENTITYID_ISSET_ID, value);
9209
    }
9210
 
9211
    public void setFieldValue(_Fields field, Object value) {
9212
      switch (field) {
9213
      case ENTITY_ID:
9214
        if (value == null) {
9215
          unsetEntityId();
9216
        } else {
9217
          setEntityId((Long)value);
9218
        }
9219
        break;
9220
 
9221
      }
9222
    }
9223
 
9224
    public Object getFieldValue(_Fields field) {
9225
      switch (field) {
9226
      case ENTITY_ID:
9227
        return Long.valueOf(getEntityId());
9228
 
9229
      }
9230
      throw new IllegalStateException();
9231
    }
9232
 
9233
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
9234
    public boolean isSet(_Fields field) {
9235
      if (field == null) {
9236
        throw new IllegalArgumentException();
9237
      }
9238
 
9239
      switch (field) {
9240
      case ENTITY_ID:
9241
        return isSetEntityId();
9242
      }
9243
      throw new IllegalStateException();
9244
    }
9245
 
9246
    @Override
9247
    public boolean equals(Object that) {
9248
      if (that == null)
9249
        return false;
9250
      if (that instanceof getDiscountsForEntity_args)
9251
        return this.equals((getDiscountsForEntity_args)that);
9252
      return false;
9253
    }
9254
 
9255
    public boolean equals(getDiscountsForEntity_args that) {
9256
      if (that == null)
9257
        return false;
9258
 
9259
      boolean this_present_entityId = true;
9260
      boolean that_present_entityId = true;
9261
      if (this_present_entityId || that_present_entityId) {
9262
        if (!(this_present_entityId && that_present_entityId))
9263
          return false;
9264
        if (this.entityId != that.entityId)
9265
          return false;
9266
      }
9267
 
9268
      return true;
9269
    }
9270
 
9271
    @Override
9272
    public int hashCode() {
9273
      return 0;
9274
    }
9275
 
9276
    public int compareTo(getDiscountsForEntity_args other) {
9277
      if (!getClass().equals(other.getClass())) {
9278
        return getClass().getName().compareTo(other.getClass().getName());
9279
      }
9280
 
9281
      int lastComparison = 0;
9282
      getDiscountsForEntity_args typedOther = (getDiscountsForEntity_args)other;
9283
 
9284
      lastComparison = Boolean.valueOf(isSetEntityId()).compareTo(typedOther.isSetEntityId());
9285
      if (lastComparison != 0) {
9286
        return lastComparison;
9287
      }
9288
      if (isSetEntityId()) {
9289
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityId, typedOther.entityId);
9290
        if (lastComparison != 0) {
9291
          return lastComparison;
9292
        }
9293
      }
9294
      return 0;
9295
    }
9296
 
9297
    public _Fields fieldForId(int fieldId) {
9298
      return _Fields.findByThriftId(fieldId);
9299
    }
9300
 
9301
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
9302
      org.apache.thrift.protocol.TField field;
9303
      iprot.readStructBegin();
9304
      while (true)
9305
      {
9306
        field = iprot.readFieldBegin();
9307
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
9308
          break;
9309
        }
9310
        switch (field.id) {
9311
          case 1: // ENTITY_ID
9312
            if (field.type == org.apache.thrift.protocol.TType.I64) {
9313
              this.entityId = iprot.readI64();
9314
              setEntityIdIsSet(true);
9315
            } else { 
9316
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9317
            }
9318
            break;
9319
          default:
9320
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9321
        }
9322
        iprot.readFieldEnd();
9323
      }
9324
      iprot.readStructEnd();
9325
      validate();
9326
    }
9327
 
9328
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
9329
      validate();
9330
 
9331
      oprot.writeStructBegin(STRUCT_DESC);
9332
      oprot.writeFieldBegin(ENTITY_ID_FIELD_DESC);
9333
      oprot.writeI64(this.entityId);
9334
      oprot.writeFieldEnd();
9335
      oprot.writeFieldStop();
9336
      oprot.writeStructEnd();
9337
    }
9338
 
9339
    @Override
9340
    public String toString() {
9341
      StringBuilder sb = new StringBuilder("getDiscountsForEntity_args(");
9342
      boolean first = true;
9343
 
9344
      sb.append("entityId:");
9345
      sb.append(this.entityId);
9346
      first = false;
9347
      sb.append(")");
9348
      return sb.toString();
9349
    }
9350
 
9351
    public void validate() throws org.apache.thrift.TException {
9352
      // check for required fields
9353
    }
9354
 
9355
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
9356
      try {
9357
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
9358
      } catch (org.apache.thrift.TException te) {
9359
        throw new java.io.IOException(te);
9360
      }
9361
    }
9362
 
9363
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
9364
      try {
9365
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
9366
        __isset_bit_vector = new BitSet(1);
9367
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
9368
      } catch (org.apache.thrift.TException te) {
9369
        throw new java.io.IOException(te);
9370
      }
9371
    }
9372
 
9373
  }
9374
 
9375
  public static class getDiscountsForEntity_result implements org.apache.thrift.TBase<getDiscountsForEntity_result, getDiscountsForEntity_result._Fields>, java.io.Serializable, Cloneable   {
9376
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getDiscountsForEntity_result");
9377
 
9378
    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);
9379
 
9380
    private Map<String,Double> success; // required
9381
 
9382
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
9383
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
9384
      SUCCESS((short)0, "success");
9385
 
9386
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
9387
 
9388
      static {
9389
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
9390
          byName.put(field.getFieldName(), field);
9391
        }
9392
      }
9393
 
9394
      /**
9395
       * Find the _Fields constant that matches fieldId, or null if its not found.
9396
       */
9397
      public static _Fields findByThriftId(int fieldId) {
9398
        switch(fieldId) {
9399
          case 0: // SUCCESS
9400
            return SUCCESS;
9401
          default:
9402
            return null;
9403
        }
9404
      }
9405
 
9406
      /**
9407
       * Find the _Fields constant that matches fieldId, throwing an exception
9408
       * if it is not found.
9409
       */
9410
      public static _Fields findByThriftIdOrThrow(int fieldId) {
9411
        _Fields fields = findByThriftId(fieldId);
9412
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
9413
        return fields;
9414
      }
9415
 
9416
      /**
9417
       * Find the _Fields constant that matches name, or null if its not found.
9418
       */
9419
      public static _Fields findByName(String name) {
9420
        return byName.get(name);
9421
      }
9422
 
9423
      private final short _thriftId;
9424
      private final String _fieldName;
9425
 
9426
      _Fields(short thriftId, String fieldName) {
9427
        _thriftId = thriftId;
9428
        _fieldName = fieldName;
9429
      }
9430
 
9431
      public short getThriftFieldId() {
9432
        return _thriftId;
9433
      }
9434
 
9435
      public String getFieldName() {
9436
        return _fieldName;
9437
      }
9438
    }
9439
 
9440
    // isset id assignments
9441
 
9442
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
9443
    static {
9444
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
9445
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9446
          new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
9447
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), 
9448
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))));
9449
      metaDataMap = Collections.unmodifiableMap(tmpMap);
9450
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getDiscountsForEntity_result.class, metaDataMap);
9451
    }
9452
 
9453
    public getDiscountsForEntity_result() {
9454
    }
9455
 
9456
    public getDiscountsForEntity_result(
9457
      Map<String,Double> success)
9458
    {
9459
      this();
9460
      this.success = success;
9461
    }
9462
 
9463
    /**
9464
     * Performs a deep copy on <i>other</i>.
9465
     */
9466
    public getDiscountsForEntity_result(getDiscountsForEntity_result other) {
9467
      if (other.isSetSuccess()) {
9468
        Map<String,Double> __this__success = new HashMap<String,Double>();
9469
        for (Map.Entry<String, Double> other_element : other.success.entrySet()) {
9470
 
9471
          String other_element_key = other_element.getKey();
9472
          Double other_element_value = other_element.getValue();
9473
 
9474
          String __this__success_copy_key = other_element_key;
9475
 
9476
          Double __this__success_copy_value = other_element_value;
9477
 
9478
          __this__success.put(__this__success_copy_key, __this__success_copy_value);
9479
        }
9480
        this.success = __this__success;
9481
      }
9482
    }
9483
 
9484
    public getDiscountsForEntity_result deepCopy() {
9485
      return new getDiscountsForEntity_result(this);
9486
    }
9487
 
9488
    @Override
9489
    public void clear() {
9490
      this.success = null;
9491
    }
9492
 
9493
    public int getSuccessSize() {
9494
      return (this.success == null) ? 0 : this.success.size();
9495
    }
9496
 
9497
    public void putToSuccess(String key, double val) {
9498
      if (this.success == null) {
9499
        this.success = new HashMap<String,Double>();
9500
      }
9501
      this.success.put(key, val);
9502
    }
9503
 
9504
    public Map<String,Double> getSuccess() {
9505
      return this.success;
9506
    }
9507
 
9508
    public void setSuccess(Map<String,Double> success) {
9509
      this.success = success;
9510
    }
9511
 
9512
    public void unsetSuccess() {
9513
      this.success = null;
9514
    }
9515
 
9516
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
9517
    public boolean isSetSuccess() {
9518
      return this.success != null;
9519
    }
9520
 
9521
    public void setSuccessIsSet(boolean value) {
9522
      if (!value) {
9523
        this.success = null;
9524
      }
9525
    }
9526
 
9527
    public void setFieldValue(_Fields field, Object value) {
9528
      switch (field) {
9529
      case SUCCESS:
9530
        if (value == null) {
9531
          unsetSuccess();
9532
        } else {
9533
          setSuccess((Map<String,Double>)value);
9534
        }
9535
        break;
9536
 
9537
      }
9538
    }
9539
 
9540
    public Object getFieldValue(_Fields field) {
9541
      switch (field) {
9542
      case SUCCESS:
9543
        return getSuccess();
9544
 
9545
      }
9546
      throw new IllegalStateException();
9547
    }
9548
 
9549
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
9550
    public boolean isSet(_Fields field) {
9551
      if (field == null) {
9552
        throw new IllegalArgumentException();
9553
      }
9554
 
9555
      switch (field) {
9556
      case SUCCESS:
9557
        return isSetSuccess();
9558
      }
9559
      throw new IllegalStateException();
9560
    }
9561
 
9562
    @Override
9563
    public boolean equals(Object that) {
9564
      if (that == null)
9565
        return false;
9566
      if (that instanceof getDiscountsForEntity_result)
9567
        return this.equals((getDiscountsForEntity_result)that);
9568
      return false;
9569
    }
9570
 
9571
    public boolean equals(getDiscountsForEntity_result that) {
9572
      if (that == null)
9573
        return false;
9574
 
9575
      boolean this_present_success = true && this.isSetSuccess();
9576
      boolean that_present_success = true && that.isSetSuccess();
9577
      if (this_present_success || that_present_success) {
9578
        if (!(this_present_success && that_present_success))
9579
          return false;
9580
        if (!this.success.equals(that.success))
9581
          return false;
9582
      }
9583
 
9584
      return true;
9585
    }
9586
 
9587
    @Override
9588
    public int hashCode() {
9589
      return 0;
9590
    }
9591
 
9592
    public int compareTo(getDiscountsForEntity_result other) {
9593
      if (!getClass().equals(other.getClass())) {
9594
        return getClass().getName().compareTo(other.getClass().getName());
9595
      }
9596
 
9597
      int lastComparison = 0;
9598
      getDiscountsForEntity_result typedOther = (getDiscountsForEntity_result)other;
9599
 
9600
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
9601
      if (lastComparison != 0) {
9602
        return lastComparison;
9603
      }
9604
      if (isSetSuccess()) {
9605
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
9606
        if (lastComparison != 0) {
9607
          return lastComparison;
9608
        }
9609
      }
9610
      return 0;
9611
    }
9612
 
9613
    public _Fields fieldForId(int fieldId) {
9614
      return _Fields.findByThriftId(fieldId);
9615
    }
9616
 
9617
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
9618
      org.apache.thrift.protocol.TField field;
9619
      iprot.readStructBegin();
9620
      while (true)
9621
      {
9622
        field = iprot.readFieldBegin();
9623
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
9624
          break;
9625
        }
9626
        switch (field.id) {
9627
          case 0: // SUCCESS
9628
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
9629
              {
5327 rajveer 9630
                org.apache.thrift.protocol.TMap _map28 = iprot.readMapBegin();
9631
                this.success = new HashMap<String,Double>(2*_map28.size);
9632
                for (int _i29 = 0; _i29 < _map28.size; ++_i29)
4494 varun.gupt 9633
                {
5327 rajveer 9634
                  String _key30; // required
9635
                  double _val31; // required
9636
                  _key30 = iprot.readString();
9637
                  _val31 = iprot.readDouble();
9638
                  this.success.put(_key30, _val31);
4494 varun.gupt 9639
                }
9640
                iprot.readMapEnd();
9641
              }
9642
            } else { 
9643
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9644
            }
9645
            break;
9646
          default:
9647
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9648
        }
9649
        iprot.readFieldEnd();
9650
      }
9651
      iprot.readStructEnd();
9652
      validate();
9653
    }
9654
 
9655
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
9656
      oprot.writeStructBegin(STRUCT_DESC);
9657
 
9658
      if (this.isSetSuccess()) {
9659
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
9660
        {
9661
          oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.DOUBLE, this.success.size()));
5327 rajveer 9662
          for (Map.Entry<String, Double> _iter32 : this.success.entrySet())
4494 varun.gupt 9663
          {
5327 rajveer 9664
            oprot.writeString(_iter32.getKey());
9665
            oprot.writeDouble(_iter32.getValue());
4494 varun.gupt 9666
          }
9667
          oprot.writeMapEnd();
9668
        }
9669
        oprot.writeFieldEnd();
9670
      }
9671
      oprot.writeFieldStop();
9672
      oprot.writeStructEnd();
9673
    }
9674
 
9675
    @Override
9676
    public String toString() {
9677
      StringBuilder sb = new StringBuilder("getDiscountsForEntity_result(");
9678
      boolean first = true;
9679
 
9680
      sb.append("success:");
9681
      if (this.success == null) {
9682
        sb.append("null");
9683
      } else {
9684
        sb.append(this.success);
9685
      }
9686
      first = false;
9687
      sb.append(")");
9688
      return sb.toString();
9689
    }
9690
 
9691
    public void validate() throws org.apache.thrift.TException {
9692
      // check for required fields
9693
    }
9694
 
9695
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
9696
      try {
9697
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
9698
      } catch (org.apache.thrift.TException te) {
9699
        throw new java.io.IOException(te);
9700
      }
9701
    }
9702
 
9703
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
9704
      try {
9705
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
9706
      } catch (org.apache.thrift.TException te) {
9707
        throw new java.io.IOException(te);
9708
      }
9709
    }
9710
 
9711
  }
9712
 
5469 rajveer 9713
  public static class addVoucher_args implements org.apache.thrift.TBase<addVoucher_args, addVoucher_args._Fields>, java.io.Serializable, Cloneable   {
9714
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addVoucher_args");
9715
 
9716
    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);
9717
 
9718
    private Voucher voucher; // required
9719
 
9720
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
9721
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
9722
      VOUCHER((short)1, "voucher");
9723
 
9724
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
9725
 
9726
      static {
9727
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
9728
          byName.put(field.getFieldName(), field);
9729
        }
9730
      }
9731
 
9732
      /**
9733
       * Find the _Fields constant that matches fieldId, or null if its not found.
9734
       */
9735
      public static _Fields findByThriftId(int fieldId) {
9736
        switch(fieldId) {
9737
          case 1: // VOUCHER
9738
            return VOUCHER;
9739
          default:
9740
            return null;
9741
        }
9742
      }
9743
 
9744
      /**
9745
       * Find the _Fields constant that matches fieldId, throwing an exception
9746
       * if it is not found.
9747
       */
9748
      public static _Fields findByThriftIdOrThrow(int fieldId) {
9749
        _Fields fields = findByThriftId(fieldId);
9750
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
9751
        return fields;
9752
      }
9753
 
9754
      /**
9755
       * Find the _Fields constant that matches name, or null if its not found.
9756
       */
9757
      public static _Fields findByName(String name) {
9758
        return byName.get(name);
9759
      }
9760
 
9761
      private final short _thriftId;
9762
      private final String _fieldName;
9763
 
9764
      _Fields(short thriftId, String fieldName) {
9765
        _thriftId = thriftId;
9766
        _fieldName = fieldName;
9767
      }
9768
 
9769
      public short getThriftFieldId() {
9770
        return _thriftId;
9771
      }
9772
 
9773
      public String getFieldName() {
9774
        return _fieldName;
9775
      }
9776
    }
9777
 
9778
    // isset id assignments
9779
 
9780
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
9781
    static {
9782
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
9783
      tmpMap.put(_Fields.VOUCHER, new org.apache.thrift.meta_data.FieldMetaData("voucher", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9784
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Voucher.class)));
9785
      metaDataMap = Collections.unmodifiableMap(tmpMap);
9786
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addVoucher_args.class, metaDataMap);
9787
    }
9788
 
9789
    public addVoucher_args() {
9790
    }
9791
 
9792
    public addVoucher_args(
9793
      Voucher voucher)
9794
    {
9795
      this();
9796
      this.voucher = voucher;
9797
    }
9798
 
9799
    /**
9800
     * Performs a deep copy on <i>other</i>.
9801
     */
9802
    public addVoucher_args(addVoucher_args other) {
9803
      if (other.isSetVoucher()) {
9804
        this.voucher = new Voucher(other.voucher);
9805
      }
9806
    }
9807
 
9808
    public addVoucher_args deepCopy() {
9809
      return new addVoucher_args(this);
9810
    }
9811
 
9812
    @Override
9813
    public void clear() {
9814
      this.voucher = null;
9815
    }
9816
 
9817
    public Voucher getVoucher() {
9818
      return this.voucher;
9819
    }
9820
 
9821
    public void setVoucher(Voucher voucher) {
9822
      this.voucher = voucher;
9823
    }
9824
 
9825
    public void unsetVoucher() {
9826
      this.voucher = null;
9827
    }
9828
 
9829
    /** Returns true if field voucher is set (has been assigned a value) and false otherwise */
9830
    public boolean isSetVoucher() {
9831
      return this.voucher != null;
9832
    }
9833
 
9834
    public void setVoucherIsSet(boolean value) {
9835
      if (!value) {
9836
        this.voucher = null;
9837
      }
9838
    }
9839
 
9840
    public void setFieldValue(_Fields field, Object value) {
9841
      switch (field) {
9842
      case VOUCHER:
9843
        if (value == null) {
9844
          unsetVoucher();
9845
        } else {
9846
          setVoucher((Voucher)value);
9847
        }
9848
        break;
9849
 
9850
      }
9851
    }
9852
 
9853
    public Object getFieldValue(_Fields field) {
9854
      switch (field) {
9855
      case VOUCHER:
9856
        return getVoucher();
9857
 
9858
      }
9859
      throw new IllegalStateException();
9860
    }
9861
 
9862
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
9863
    public boolean isSet(_Fields field) {
9864
      if (field == null) {
9865
        throw new IllegalArgumentException();
9866
      }
9867
 
9868
      switch (field) {
9869
      case VOUCHER:
9870
        return isSetVoucher();
9871
      }
9872
      throw new IllegalStateException();
9873
    }
9874
 
9875
    @Override
9876
    public boolean equals(Object that) {
9877
      if (that == null)
9878
        return false;
9879
      if (that instanceof addVoucher_args)
9880
        return this.equals((addVoucher_args)that);
9881
      return false;
9882
    }
9883
 
9884
    public boolean equals(addVoucher_args that) {
9885
      if (that == null)
9886
        return false;
9887
 
9888
      boolean this_present_voucher = true && this.isSetVoucher();
9889
      boolean that_present_voucher = true && that.isSetVoucher();
9890
      if (this_present_voucher || that_present_voucher) {
9891
        if (!(this_present_voucher && that_present_voucher))
9892
          return false;
9893
        if (!this.voucher.equals(that.voucher))
9894
          return false;
9895
      }
9896
 
9897
      return true;
9898
    }
9899
 
9900
    @Override
9901
    public int hashCode() {
9902
      return 0;
9903
    }
9904
 
9905
    public int compareTo(addVoucher_args other) {
9906
      if (!getClass().equals(other.getClass())) {
9907
        return getClass().getName().compareTo(other.getClass().getName());
9908
      }
9909
 
9910
      int lastComparison = 0;
9911
      addVoucher_args typedOther = (addVoucher_args)other;
9912
 
9913
      lastComparison = Boolean.valueOf(isSetVoucher()).compareTo(typedOther.isSetVoucher());
9914
      if (lastComparison != 0) {
9915
        return lastComparison;
9916
      }
9917
      if (isSetVoucher()) {
9918
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.voucher, typedOther.voucher);
9919
        if (lastComparison != 0) {
9920
          return lastComparison;
9921
        }
9922
      }
9923
      return 0;
9924
    }
9925
 
9926
    public _Fields fieldForId(int fieldId) {
9927
      return _Fields.findByThriftId(fieldId);
9928
    }
9929
 
9930
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
9931
      org.apache.thrift.protocol.TField field;
9932
      iprot.readStructBegin();
9933
      while (true)
9934
      {
9935
        field = iprot.readFieldBegin();
9936
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
9937
          break;
9938
        }
9939
        switch (field.id) {
9940
          case 1: // VOUCHER
9941
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
9942
              this.voucher = new Voucher();
9943
              this.voucher.read(iprot);
9944
            } else { 
9945
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9946
            }
9947
            break;
9948
          default:
9949
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9950
        }
9951
        iprot.readFieldEnd();
9952
      }
9953
      iprot.readStructEnd();
9954
      validate();
9955
    }
9956
 
9957
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
9958
      validate();
9959
 
9960
      oprot.writeStructBegin(STRUCT_DESC);
9961
      if (this.voucher != null) {
9962
        oprot.writeFieldBegin(VOUCHER_FIELD_DESC);
9963
        this.voucher.write(oprot);
9964
        oprot.writeFieldEnd();
9965
      }
9966
      oprot.writeFieldStop();
9967
      oprot.writeStructEnd();
9968
    }
9969
 
9970
    @Override
9971
    public String toString() {
9972
      StringBuilder sb = new StringBuilder("addVoucher_args(");
9973
      boolean first = true;
9974
 
9975
      sb.append("voucher:");
9976
      if (this.voucher == null) {
9977
        sb.append("null");
9978
      } else {
9979
        sb.append(this.voucher);
9980
      }
9981
      first = false;
9982
      sb.append(")");
9983
      return sb.toString();
9984
    }
9985
 
9986
    public void validate() throws org.apache.thrift.TException {
9987
      // check for required fields
9988
    }
9989
 
9990
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
9991
      try {
9992
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
9993
      } catch (org.apache.thrift.TException te) {
9994
        throw new java.io.IOException(te);
9995
      }
9996
    }
9997
 
9998
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
9999
      try {
10000
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
10001
      } catch (org.apache.thrift.TException te) {
10002
        throw new java.io.IOException(te);
10003
      }
10004
    }
10005
 
10006
  }
10007
 
10008
  public static class addVoucher_result implements org.apache.thrift.TBase<addVoucher_result, addVoucher_result._Fields>, java.io.Serializable, Cloneable   {
10009
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addVoucher_result");
10010
 
10011
 
10012
 
10013
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
10014
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
10015
;
10016
 
10017
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
10018
 
10019
      static {
10020
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
10021
          byName.put(field.getFieldName(), field);
10022
        }
10023
      }
10024
 
10025
      /**
10026
       * Find the _Fields constant that matches fieldId, or null if its not found.
10027
       */
10028
      public static _Fields findByThriftId(int fieldId) {
10029
        switch(fieldId) {
10030
          default:
10031
            return null;
10032
        }
10033
      }
10034
 
10035
      /**
10036
       * Find the _Fields constant that matches fieldId, throwing an exception
10037
       * if it is not found.
10038
       */
10039
      public static _Fields findByThriftIdOrThrow(int fieldId) {
10040
        _Fields fields = findByThriftId(fieldId);
10041
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
10042
        return fields;
10043
      }
10044
 
10045
      /**
10046
       * Find the _Fields constant that matches name, or null if its not found.
10047
       */
10048
      public static _Fields findByName(String name) {
10049
        return byName.get(name);
10050
      }
10051
 
10052
      private final short _thriftId;
10053
      private final String _fieldName;
10054
 
10055
      _Fields(short thriftId, String fieldName) {
10056
        _thriftId = thriftId;
10057
        _fieldName = fieldName;
10058
      }
10059
 
10060
      public short getThriftFieldId() {
10061
        return _thriftId;
10062
      }
10063
 
10064
      public String getFieldName() {
10065
        return _fieldName;
10066
      }
10067
    }
10068
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
10069
    static {
10070
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
10071
      metaDataMap = Collections.unmodifiableMap(tmpMap);
10072
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addVoucher_result.class, metaDataMap);
10073
    }
10074
 
10075
    public addVoucher_result() {
10076
    }
10077
 
10078
    /**
10079
     * Performs a deep copy on <i>other</i>.
10080
     */
10081
    public addVoucher_result(addVoucher_result other) {
10082
    }
10083
 
10084
    public addVoucher_result deepCopy() {
10085
      return new addVoucher_result(this);
10086
    }
10087
 
10088
    @Override
10089
    public void clear() {
10090
    }
10091
 
10092
    public void setFieldValue(_Fields field, Object value) {
10093
      switch (field) {
10094
      }
10095
    }
10096
 
10097
    public Object getFieldValue(_Fields field) {
10098
      switch (field) {
10099
      }
10100
      throw new IllegalStateException();
10101
    }
10102
 
10103
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
10104
    public boolean isSet(_Fields field) {
10105
      if (field == null) {
10106
        throw new IllegalArgumentException();
10107
      }
10108
 
10109
      switch (field) {
10110
      }
10111
      throw new IllegalStateException();
10112
    }
10113
 
10114
    @Override
10115
    public boolean equals(Object that) {
10116
      if (that == null)
10117
        return false;
10118
      if (that instanceof addVoucher_result)
10119
        return this.equals((addVoucher_result)that);
10120
      return false;
10121
    }
10122
 
10123
    public boolean equals(addVoucher_result that) {
10124
      if (that == null)
10125
        return false;
10126
 
10127
      return true;
10128
    }
10129
 
10130
    @Override
10131
    public int hashCode() {
10132
      return 0;
10133
    }
10134
 
10135
    public int compareTo(addVoucher_result other) {
10136
      if (!getClass().equals(other.getClass())) {
10137
        return getClass().getName().compareTo(other.getClass().getName());
10138
      }
10139
 
10140
      int lastComparison = 0;
10141
      addVoucher_result typedOther = (addVoucher_result)other;
10142
 
10143
      return 0;
10144
    }
10145
 
10146
    public _Fields fieldForId(int fieldId) {
10147
      return _Fields.findByThriftId(fieldId);
10148
    }
10149
 
10150
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
10151
      org.apache.thrift.protocol.TField field;
10152
      iprot.readStructBegin();
10153
      while (true)
10154
      {
10155
        field = iprot.readFieldBegin();
10156
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
10157
          break;
10158
        }
10159
        switch (field.id) {
10160
          default:
10161
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10162
        }
10163
        iprot.readFieldEnd();
10164
      }
10165
      iprot.readStructEnd();
10166
      validate();
10167
    }
10168
 
10169
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
10170
      oprot.writeStructBegin(STRUCT_DESC);
10171
 
10172
      oprot.writeFieldStop();
10173
      oprot.writeStructEnd();
10174
    }
10175
 
10176
    @Override
10177
    public String toString() {
10178
      StringBuilder sb = new StringBuilder("addVoucher_result(");
10179
      boolean first = true;
10180
 
10181
      sb.append(")");
10182
      return sb.toString();
10183
    }
10184
 
10185
    public void validate() throws org.apache.thrift.TException {
10186
      // check for required fields
10187
    }
10188
 
10189
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
10190
      try {
10191
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
10192
      } catch (org.apache.thrift.TException te) {
10193
        throw new java.io.IOException(te);
10194
      }
10195
    }
10196
 
10197
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
10198
      try {
10199
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
10200
      } catch (org.apache.thrift.TException te) {
10201
        throw new java.io.IOException(te);
10202
      }
10203
    }
10204
 
10205
  }
10206
 
10207
  public static class assignVoucher_args implements org.apache.thrift.TBase<assignVoucher_args, assignVoucher_args._Fields>, java.io.Serializable, Cloneable   {
10208
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("assignVoucher_args");
10209
 
10210
    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);
10211
    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);
10212
    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);
10213
    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);
10214
 
10215
    private long userId; // required
10216
    private String userEmail; // required
10217
    private VoucherType voucherType; // required
10218
    private long amount; // required
10219
 
10220
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
10221
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
10222
      USER_ID((short)1, "userId"),
10223
      USER_EMAIL((short)2, "userEmail"),
10224
      /**
10225
       * 
10226
       * @see VoucherType
10227
       */
10228
      VOUCHER_TYPE((short)3, "voucherType"),
10229
      AMOUNT((short)4, "amount");
10230
 
10231
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
10232
 
10233
      static {
10234
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
10235
          byName.put(field.getFieldName(), field);
10236
        }
10237
      }
10238
 
10239
      /**
10240
       * Find the _Fields constant that matches fieldId, or null if its not found.
10241
       */
10242
      public static _Fields findByThriftId(int fieldId) {
10243
        switch(fieldId) {
10244
          case 1: // USER_ID
10245
            return USER_ID;
10246
          case 2: // USER_EMAIL
10247
            return USER_EMAIL;
10248
          case 3: // VOUCHER_TYPE
10249
            return VOUCHER_TYPE;
10250
          case 4: // AMOUNT
10251
            return AMOUNT;
10252
          default:
10253
            return null;
10254
        }
10255
      }
10256
 
10257
      /**
10258
       * Find the _Fields constant that matches fieldId, throwing an exception
10259
       * if it is not found.
10260
       */
10261
      public static _Fields findByThriftIdOrThrow(int fieldId) {
10262
        _Fields fields = findByThriftId(fieldId);
10263
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
10264
        return fields;
10265
      }
10266
 
10267
      /**
10268
       * Find the _Fields constant that matches name, or null if its not found.
10269
       */
10270
      public static _Fields findByName(String name) {
10271
        return byName.get(name);
10272
      }
10273
 
10274
      private final short _thriftId;
10275
      private final String _fieldName;
10276
 
10277
      _Fields(short thriftId, String fieldName) {
10278
        _thriftId = thriftId;
10279
        _fieldName = fieldName;
10280
      }
10281
 
10282
      public short getThriftFieldId() {
10283
        return _thriftId;
10284
      }
10285
 
10286
      public String getFieldName() {
10287
        return _fieldName;
10288
      }
10289
    }
10290
 
10291
    // isset id assignments
10292
    private static final int __USERID_ISSET_ID = 0;
10293
    private static final int __AMOUNT_ISSET_ID = 1;
10294
    private BitSet __isset_bit_vector = new BitSet(2);
10295
 
10296
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
10297
    static {
10298
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
10299
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10300
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
10301
      tmpMap.put(_Fields.USER_EMAIL, new org.apache.thrift.meta_data.FieldMetaData("userEmail", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10302
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
10303
      tmpMap.put(_Fields.VOUCHER_TYPE, new org.apache.thrift.meta_data.FieldMetaData("voucherType", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10304
          new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, VoucherType.class)));
10305
      tmpMap.put(_Fields.AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("amount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10306
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
10307
      metaDataMap = Collections.unmodifiableMap(tmpMap);
10308
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(assignVoucher_args.class, metaDataMap);
10309
    }
10310
 
10311
    public assignVoucher_args() {
10312
    }
10313
 
10314
    public assignVoucher_args(
10315
      long userId,
10316
      String userEmail,
10317
      VoucherType voucherType,
10318
      long amount)
10319
    {
10320
      this();
10321
      this.userId = userId;
10322
      setUserIdIsSet(true);
10323
      this.userEmail = userEmail;
10324
      this.voucherType = voucherType;
10325
      this.amount = amount;
10326
      setAmountIsSet(true);
10327
    }
10328
 
10329
    /**
10330
     * Performs a deep copy on <i>other</i>.
10331
     */
10332
    public assignVoucher_args(assignVoucher_args other) {
10333
      __isset_bit_vector.clear();
10334
      __isset_bit_vector.or(other.__isset_bit_vector);
10335
      this.userId = other.userId;
10336
      if (other.isSetUserEmail()) {
10337
        this.userEmail = other.userEmail;
10338
      }
10339
      if (other.isSetVoucherType()) {
10340
        this.voucherType = other.voucherType;
10341
      }
10342
      this.amount = other.amount;
10343
    }
10344
 
10345
    public assignVoucher_args deepCopy() {
10346
      return new assignVoucher_args(this);
10347
    }
10348
 
10349
    @Override
10350
    public void clear() {
10351
      setUserIdIsSet(false);
10352
      this.userId = 0;
10353
      this.userEmail = null;
10354
      this.voucherType = null;
10355
      setAmountIsSet(false);
10356
      this.amount = 0;
10357
    }
10358
 
10359
    public long getUserId() {
10360
      return this.userId;
10361
    }
10362
 
10363
    public void setUserId(long userId) {
10364
      this.userId = userId;
10365
      setUserIdIsSet(true);
10366
    }
10367
 
10368
    public void unsetUserId() {
10369
      __isset_bit_vector.clear(__USERID_ISSET_ID);
10370
    }
10371
 
10372
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
10373
    public boolean isSetUserId() {
10374
      return __isset_bit_vector.get(__USERID_ISSET_ID);
10375
    }
10376
 
10377
    public void setUserIdIsSet(boolean value) {
10378
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
10379
    }
10380
 
10381
    public String getUserEmail() {
10382
      return this.userEmail;
10383
    }
10384
 
10385
    public void setUserEmail(String userEmail) {
10386
      this.userEmail = userEmail;
10387
    }
10388
 
10389
    public void unsetUserEmail() {
10390
      this.userEmail = null;
10391
    }
10392
 
10393
    /** Returns true if field userEmail is set (has been assigned a value) and false otherwise */
10394
    public boolean isSetUserEmail() {
10395
      return this.userEmail != null;
10396
    }
10397
 
10398
    public void setUserEmailIsSet(boolean value) {
10399
      if (!value) {
10400
        this.userEmail = null;
10401
      }
10402
    }
10403
 
10404
    /**
10405
     * 
10406
     * @see VoucherType
10407
     */
10408
    public VoucherType getVoucherType() {
10409
      return this.voucherType;
10410
    }
10411
 
10412
    /**
10413
     * 
10414
     * @see VoucherType
10415
     */
10416
    public void setVoucherType(VoucherType voucherType) {
10417
      this.voucherType = voucherType;
10418
    }
10419
 
10420
    public void unsetVoucherType() {
10421
      this.voucherType = null;
10422
    }
10423
 
10424
    /** Returns true if field voucherType is set (has been assigned a value) and false otherwise */
10425
    public boolean isSetVoucherType() {
10426
      return this.voucherType != null;
10427
    }
10428
 
10429
    public void setVoucherTypeIsSet(boolean value) {
10430
      if (!value) {
10431
        this.voucherType = null;
10432
      }
10433
    }
10434
 
10435
    public long getAmount() {
10436
      return this.amount;
10437
    }
10438
 
10439
    public void setAmount(long amount) {
10440
      this.amount = amount;
10441
      setAmountIsSet(true);
10442
    }
10443
 
10444
    public void unsetAmount() {
10445
      __isset_bit_vector.clear(__AMOUNT_ISSET_ID);
10446
    }
10447
 
10448
    /** Returns true if field amount is set (has been assigned a value) and false otherwise */
10449
    public boolean isSetAmount() {
10450
      return __isset_bit_vector.get(__AMOUNT_ISSET_ID);
10451
    }
10452
 
10453
    public void setAmountIsSet(boolean value) {
10454
      __isset_bit_vector.set(__AMOUNT_ISSET_ID, value);
10455
    }
10456
 
10457
    public void setFieldValue(_Fields field, Object value) {
10458
      switch (field) {
10459
      case USER_ID:
10460
        if (value == null) {
10461
          unsetUserId();
10462
        } else {
10463
          setUserId((Long)value);
10464
        }
10465
        break;
10466
 
10467
      case USER_EMAIL:
10468
        if (value == null) {
10469
          unsetUserEmail();
10470
        } else {
10471
          setUserEmail((String)value);
10472
        }
10473
        break;
10474
 
10475
      case VOUCHER_TYPE:
10476
        if (value == null) {
10477
          unsetVoucherType();
10478
        } else {
10479
          setVoucherType((VoucherType)value);
10480
        }
10481
        break;
10482
 
10483
      case AMOUNT:
10484
        if (value == null) {
10485
          unsetAmount();
10486
        } else {
10487
          setAmount((Long)value);
10488
        }
10489
        break;
10490
 
10491
      }
10492
    }
10493
 
10494
    public Object getFieldValue(_Fields field) {
10495
      switch (field) {
10496
      case USER_ID:
10497
        return Long.valueOf(getUserId());
10498
 
10499
      case USER_EMAIL:
10500
        return getUserEmail();
10501
 
10502
      case VOUCHER_TYPE:
10503
        return getVoucherType();
10504
 
10505
      case AMOUNT:
10506
        return Long.valueOf(getAmount());
10507
 
10508
      }
10509
      throw new IllegalStateException();
10510
    }
10511
 
10512
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
10513
    public boolean isSet(_Fields field) {
10514
      if (field == null) {
10515
        throw new IllegalArgumentException();
10516
      }
10517
 
10518
      switch (field) {
10519
      case USER_ID:
10520
        return isSetUserId();
10521
      case USER_EMAIL:
10522
        return isSetUserEmail();
10523
      case VOUCHER_TYPE:
10524
        return isSetVoucherType();
10525
      case AMOUNT:
10526
        return isSetAmount();
10527
      }
10528
      throw new IllegalStateException();
10529
    }
10530
 
10531
    @Override
10532
    public boolean equals(Object that) {
10533
      if (that == null)
10534
        return false;
10535
      if (that instanceof assignVoucher_args)
10536
        return this.equals((assignVoucher_args)that);
10537
      return false;
10538
    }
10539
 
10540
    public boolean equals(assignVoucher_args that) {
10541
      if (that == null)
10542
        return false;
10543
 
10544
      boolean this_present_userId = true;
10545
      boolean that_present_userId = true;
10546
      if (this_present_userId || that_present_userId) {
10547
        if (!(this_present_userId && that_present_userId))
10548
          return false;
10549
        if (this.userId != that.userId)
10550
          return false;
10551
      }
10552
 
10553
      boolean this_present_userEmail = true && this.isSetUserEmail();
10554
      boolean that_present_userEmail = true && that.isSetUserEmail();
10555
      if (this_present_userEmail || that_present_userEmail) {
10556
        if (!(this_present_userEmail && that_present_userEmail))
10557
          return false;
10558
        if (!this.userEmail.equals(that.userEmail))
10559
          return false;
10560
      }
10561
 
10562
      boolean this_present_voucherType = true && this.isSetVoucherType();
10563
      boolean that_present_voucherType = true && that.isSetVoucherType();
10564
      if (this_present_voucherType || that_present_voucherType) {
10565
        if (!(this_present_voucherType && that_present_voucherType))
10566
          return false;
10567
        if (!this.voucherType.equals(that.voucherType))
10568
          return false;
10569
      }
10570
 
10571
      boolean this_present_amount = true;
10572
      boolean that_present_amount = true;
10573
      if (this_present_amount || that_present_amount) {
10574
        if (!(this_present_amount && that_present_amount))
10575
          return false;
10576
        if (this.amount != that.amount)
10577
          return false;
10578
      }
10579
 
10580
      return true;
10581
    }
10582
 
10583
    @Override
10584
    public int hashCode() {
10585
      return 0;
10586
    }
10587
 
10588
    public int compareTo(assignVoucher_args other) {
10589
      if (!getClass().equals(other.getClass())) {
10590
        return getClass().getName().compareTo(other.getClass().getName());
10591
      }
10592
 
10593
      int lastComparison = 0;
10594
      assignVoucher_args typedOther = (assignVoucher_args)other;
10595
 
10596
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
10597
      if (lastComparison != 0) {
10598
        return lastComparison;
10599
      }
10600
      if (isSetUserId()) {
10601
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
10602
        if (lastComparison != 0) {
10603
          return lastComparison;
10604
        }
10605
      }
10606
      lastComparison = Boolean.valueOf(isSetUserEmail()).compareTo(typedOther.isSetUserEmail());
10607
      if (lastComparison != 0) {
10608
        return lastComparison;
10609
      }
10610
      if (isSetUserEmail()) {
10611
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userEmail, typedOther.userEmail);
10612
        if (lastComparison != 0) {
10613
          return lastComparison;
10614
        }
10615
      }
10616
      lastComparison = Boolean.valueOf(isSetVoucherType()).compareTo(typedOther.isSetVoucherType());
10617
      if (lastComparison != 0) {
10618
        return lastComparison;
10619
      }
10620
      if (isSetVoucherType()) {
10621
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.voucherType, typedOther.voucherType);
10622
        if (lastComparison != 0) {
10623
          return lastComparison;
10624
        }
10625
      }
10626
      lastComparison = Boolean.valueOf(isSetAmount()).compareTo(typedOther.isSetAmount());
10627
      if (lastComparison != 0) {
10628
        return lastComparison;
10629
      }
10630
      if (isSetAmount()) {
10631
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.amount, typedOther.amount);
10632
        if (lastComparison != 0) {
10633
          return lastComparison;
10634
        }
10635
      }
10636
      return 0;
10637
    }
10638
 
10639
    public _Fields fieldForId(int fieldId) {
10640
      return _Fields.findByThriftId(fieldId);
10641
    }
10642
 
10643
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
10644
      org.apache.thrift.protocol.TField field;
10645
      iprot.readStructBegin();
10646
      while (true)
10647
      {
10648
        field = iprot.readFieldBegin();
10649
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
10650
          break;
10651
        }
10652
        switch (field.id) {
10653
          case 1: // USER_ID
10654
            if (field.type == org.apache.thrift.protocol.TType.I64) {
10655
              this.userId = iprot.readI64();
10656
              setUserIdIsSet(true);
10657
            } else { 
10658
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10659
            }
10660
            break;
10661
          case 2: // USER_EMAIL
10662
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
10663
              this.userEmail = iprot.readString();
10664
            } else { 
10665
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10666
            }
10667
            break;
10668
          case 3: // VOUCHER_TYPE
10669
            if (field.type == org.apache.thrift.protocol.TType.I32) {
10670
              this.voucherType = VoucherType.findByValue(iprot.readI32());
10671
            } else { 
10672
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10673
            }
10674
            break;
10675
          case 4: // AMOUNT
10676
            if (field.type == org.apache.thrift.protocol.TType.I64) {
10677
              this.amount = iprot.readI64();
10678
              setAmountIsSet(true);
10679
            } else { 
10680
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10681
            }
10682
            break;
10683
          default:
10684
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10685
        }
10686
        iprot.readFieldEnd();
10687
      }
10688
      iprot.readStructEnd();
10689
      validate();
10690
    }
10691
 
10692
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
10693
      validate();
10694
 
10695
      oprot.writeStructBegin(STRUCT_DESC);
10696
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
10697
      oprot.writeI64(this.userId);
10698
      oprot.writeFieldEnd();
10699
      if (this.userEmail != null) {
10700
        oprot.writeFieldBegin(USER_EMAIL_FIELD_DESC);
10701
        oprot.writeString(this.userEmail);
10702
        oprot.writeFieldEnd();
10703
      }
10704
      if (this.voucherType != null) {
10705
        oprot.writeFieldBegin(VOUCHER_TYPE_FIELD_DESC);
10706
        oprot.writeI32(this.voucherType.getValue());
10707
        oprot.writeFieldEnd();
10708
      }
10709
      oprot.writeFieldBegin(AMOUNT_FIELD_DESC);
10710
      oprot.writeI64(this.amount);
10711
      oprot.writeFieldEnd();
10712
      oprot.writeFieldStop();
10713
      oprot.writeStructEnd();
10714
    }
10715
 
10716
    @Override
10717
    public String toString() {
10718
      StringBuilder sb = new StringBuilder("assignVoucher_args(");
10719
      boolean first = true;
10720
 
10721
      sb.append("userId:");
10722
      sb.append(this.userId);
10723
      first = false;
10724
      if (!first) sb.append(", ");
10725
      sb.append("userEmail:");
10726
      if (this.userEmail == null) {
10727
        sb.append("null");
10728
      } else {
10729
        sb.append(this.userEmail);
10730
      }
10731
      first = false;
10732
      if (!first) sb.append(", ");
10733
      sb.append("voucherType:");
10734
      if (this.voucherType == null) {
10735
        sb.append("null");
10736
      } else {
10737
        sb.append(this.voucherType);
10738
      }
10739
      first = false;
10740
      if (!first) sb.append(", ");
10741
      sb.append("amount:");
10742
      sb.append(this.amount);
10743
      first = false;
10744
      sb.append(")");
10745
      return sb.toString();
10746
    }
10747
 
10748
    public void validate() throws org.apache.thrift.TException {
10749
      // check for required fields
10750
    }
10751
 
10752
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
10753
      try {
10754
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
10755
      } catch (org.apache.thrift.TException te) {
10756
        throw new java.io.IOException(te);
10757
      }
10758
    }
10759
 
10760
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
10761
      try {
10762
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
10763
        __isset_bit_vector = new BitSet(1);
10764
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
10765
      } catch (org.apache.thrift.TException te) {
10766
        throw new java.io.IOException(te);
10767
      }
10768
    }
10769
 
10770
  }
10771
 
10772
  public static class assignVoucher_result implements org.apache.thrift.TBase<assignVoucher_result, assignVoucher_result._Fields>, java.io.Serializable, Cloneable   {
10773
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("assignVoucher_result");
10774
 
10775
    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);
10776
 
10777
    private Voucher success; // required
10778
 
10779
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
10780
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
10781
      SUCCESS((short)0, "success");
10782
 
10783
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
10784
 
10785
      static {
10786
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
10787
          byName.put(field.getFieldName(), field);
10788
        }
10789
      }
10790
 
10791
      /**
10792
       * Find the _Fields constant that matches fieldId, or null if its not found.
10793
       */
10794
      public static _Fields findByThriftId(int fieldId) {
10795
        switch(fieldId) {
10796
          case 0: // SUCCESS
10797
            return SUCCESS;
10798
          default:
10799
            return null;
10800
        }
10801
      }
10802
 
10803
      /**
10804
       * Find the _Fields constant that matches fieldId, throwing an exception
10805
       * if it is not found.
10806
       */
10807
      public static _Fields findByThriftIdOrThrow(int fieldId) {
10808
        _Fields fields = findByThriftId(fieldId);
10809
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
10810
        return fields;
10811
      }
10812
 
10813
      /**
10814
       * Find the _Fields constant that matches name, or null if its not found.
10815
       */
10816
      public static _Fields findByName(String name) {
10817
        return byName.get(name);
10818
      }
10819
 
10820
      private final short _thriftId;
10821
      private final String _fieldName;
10822
 
10823
      _Fields(short thriftId, String fieldName) {
10824
        _thriftId = thriftId;
10825
        _fieldName = fieldName;
10826
      }
10827
 
10828
      public short getThriftFieldId() {
10829
        return _thriftId;
10830
      }
10831
 
10832
      public String getFieldName() {
10833
        return _fieldName;
10834
      }
10835
    }
10836
 
10837
    // isset id assignments
10838
 
10839
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
10840
    static {
10841
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
10842
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10843
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Voucher.class)));
10844
      metaDataMap = Collections.unmodifiableMap(tmpMap);
10845
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(assignVoucher_result.class, metaDataMap);
10846
    }
10847
 
10848
    public assignVoucher_result() {
10849
    }
10850
 
10851
    public assignVoucher_result(
10852
      Voucher success)
10853
    {
10854
      this();
10855
      this.success = success;
10856
    }
10857
 
10858
    /**
10859
     * Performs a deep copy on <i>other</i>.
10860
     */
10861
    public assignVoucher_result(assignVoucher_result other) {
10862
      if (other.isSetSuccess()) {
10863
        this.success = new Voucher(other.success);
10864
      }
10865
    }
10866
 
10867
    public assignVoucher_result deepCopy() {
10868
      return new assignVoucher_result(this);
10869
    }
10870
 
10871
    @Override
10872
    public void clear() {
10873
      this.success = null;
10874
    }
10875
 
10876
    public Voucher getSuccess() {
10877
      return this.success;
10878
    }
10879
 
10880
    public void setSuccess(Voucher success) {
10881
      this.success = success;
10882
    }
10883
 
10884
    public void unsetSuccess() {
10885
      this.success = null;
10886
    }
10887
 
10888
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
10889
    public boolean isSetSuccess() {
10890
      return this.success != null;
10891
    }
10892
 
10893
    public void setSuccessIsSet(boolean value) {
10894
      if (!value) {
10895
        this.success = null;
10896
      }
10897
    }
10898
 
10899
    public void setFieldValue(_Fields field, Object value) {
10900
      switch (field) {
10901
      case SUCCESS:
10902
        if (value == null) {
10903
          unsetSuccess();
10904
        } else {
10905
          setSuccess((Voucher)value);
10906
        }
10907
        break;
10908
 
10909
      }
10910
    }
10911
 
10912
    public Object getFieldValue(_Fields field) {
10913
      switch (field) {
10914
      case SUCCESS:
10915
        return getSuccess();
10916
 
10917
      }
10918
      throw new IllegalStateException();
10919
    }
10920
 
10921
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
10922
    public boolean isSet(_Fields field) {
10923
      if (field == null) {
10924
        throw new IllegalArgumentException();
10925
      }
10926
 
10927
      switch (field) {
10928
      case SUCCESS:
10929
        return isSetSuccess();
10930
      }
10931
      throw new IllegalStateException();
10932
    }
10933
 
10934
    @Override
10935
    public boolean equals(Object that) {
10936
      if (that == null)
10937
        return false;
10938
      if (that instanceof assignVoucher_result)
10939
        return this.equals((assignVoucher_result)that);
10940
      return false;
10941
    }
10942
 
10943
    public boolean equals(assignVoucher_result that) {
10944
      if (that == null)
10945
        return false;
10946
 
10947
      boolean this_present_success = true && this.isSetSuccess();
10948
      boolean that_present_success = true && that.isSetSuccess();
10949
      if (this_present_success || that_present_success) {
10950
        if (!(this_present_success && that_present_success))
10951
          return false;
10952
        if (!this.success.equals(that.success))
10953
          return false;
10954
      }
10955
 
10956
      return true;
10957
    }
10958
 
10959
    @Override
10960
    public int hashCode() {
10961
      return 0;
10962
    }
10963
 
10964
    public int compareTo(assignVoucher_result other) {
10965
      if (!getClass().equals(other.getClass())) {
10966
        return getClass().getName().compareTo(other.getClass().getName());
10967
      }
10968
 
10969
      int lastComparison = 0;
10970
      assignVoucher_result typedOther = (assignVoucher_result)other;
10971
 
10972
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
10973
      if (lastComparison != 0) {
10974
        return lastComparison;
10975
      }
10976
      if (isSetSuccess()) {
10977
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
10978
        if (lastComparison != 0) {
10979
          return lastComparison;
10980
        }
10981
      }
10982
      return 0;
10983
    }
10984
 
10985
    public _Fields fieldForId(int fieldId) {
10986
      return _Fields.findByThriftId(fieldId);
10987
    }
10988
 
10989
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
10990
      org.apache.thrift.protocol.TField field;
10991
      iprot.readStructBegin();
10992
      while (true)
10993
      {
10994
        field = iprot.readFieldBegin();
10995
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
10996
          break;
10997
        }
10998
        switch (field.id) {
10999
          case 0: // SUCCESS
11000
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
11001
              this.success = new Voucher();
11002
              this.success.read(iprot);
11003
            } else { 
11004
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11005
            }
11006
            break;
11007
          default:
11008
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11009
        }
11010
        iprot.readFieldEnd();
11011
      }
11012
      iprot.readStructEnd();
11013
      validate();
11014
    }
11015
 
11016
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
11017
      oprot.writeStructBegin(STRUCT_DESC);
11018
 
11019
      if (this.isSetSuccess()) {
11020
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
11021
        this.success.write(oprot);
11022
        oprot.writeFieldEnd();
11023
      }
11024
      oprot.writeFieldStop();
11025
      oprot.writeStructEnd();
11026
    }
11027
 
11028
    @Override
11029
    public String toString() {
11030
      StringBuilder sb = new StringBuilder("assignVoucher_result(");
11031
      boolean first = true;
11032
 
11033
      sb.append("success:");
11034
      if (this.success == null) {
11035
        sb.append("null");
11036
      } else {
11037
        sb.append(this.success);
11038
      }
11039
      first = false;
11040
      sb.append(")");
11041
      return sb.toString();
11042
    }
11043
 
11044
    public void validate() throws org.apache.thrift.TException {
11045
      // check for required fields
11046
    }
11047
 
11048
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
11049
      try {
11050
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
11051
      } catch (org.apache.thrift.TException te) {
11052
        throw new java.io.IOException(te);
11053
      }
11054
    }
11055
 
11056
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
11057
      try {
11058
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
11059
      } catch (org.apache.thrift.TException te) {
11060
        throw new java.io.IOException(te);
11061
      }
11062
    }
11063
 
11064
  }
11065
 
11066
  public static class markVoucherAsRedeemed_args implements org.apache.thrift.TBase<markVoucherAsRedeemed_args, markVoucherAsRedeemed_args._Fields>, java.io.Serializable, Cloneable   {
11067
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("markVoucherAsRedeemed_args");
11068
 
11069
    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);
11070
    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);
11071
 
11072
    private String voucherCode; // required
11073
    private long redeemedOn; // required
11074
 
11075
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
11076
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
11077
      VOUCHER_CODE((short)1, "voucherCode"),
11078
      REDEEMED_ON((short)2, "redeemedOn");
11079
 
11080
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
11081
 
11082
      static {
11083
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
11084
          byName.put(field.getFieldName(), field);
11085
        }
11086
      }
11087
 
11088
      /**
11089
       * Find the _Fields constant that matches fieldId, or null if its not found.
11090
       */
11091
      public static _Fields findByThriftId(int fieldId) {
11092
        switch(fieldId) {
11093
          case 1: // VOUCHER_CODE
11094
            return VOUCHER_CODE;
11095
          case 2: // REDEEMED_ON
11096
            return REDEEMED_ON;
11097
          default:
11098
            return null;
11099
        }
11100
      }
11101
 
11102
      /**
11103
       * Find the _Fields constant that matches fieldId, throwing an exception
11104
       * if it is not found.
11105
       */
11106
      public static _Fields findByThriftIdOrThrow(int fieldId) {
11107
        _Fields fields = findByThriftId(fieldId);
11108
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
11109
        return fields;
11110
      }
11111
 
11112
      /**
11113
       * Find the _Fields constant that matches name, or null if its not found.
11114
       */
11115
      public static _Fields findByName(String name) {
11116
        return byName.get(name);
11117
      }
11118
 
11119
      private final short _thriftId;
11120
      private final String _fieldName;
11121
 
11122
      _Fields(short thriftId, String fieldName) {
11123
        _thriftId = thriftId;
11124
        _fieldName = fieldName;
11125
      }
11126
 
11127
      public short getThriftFieldId() {
11128
        return _thriftId;
11129
      }
11130
 
11131
      public String getFieldName() {
11132
        return _fieldName;
11133
      }
11134
    }
11135
 
11136
    // isset id assignments
11137
    private static final int __REDEEMEDON_ISSET_ID = 0;
11138
    private BitSet __isset_bit_vector = new BitSet(1);
11139
 
11140
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
11141
    static {
11142
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
11143
      tmpMap.put(_Fields.VOUCHER_CODE, new org.apache.thrift.meta_data.FieldMetaData("voucherCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11144
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
11145
      tmpMap.put(_Fields.REDEEMED_ON, new org.apache.thrift.meta_data.FieldMetaData("redeemedOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11146
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
11147
      metaDataMap = Collections.unmodifiableMap(tmpMap);
11148
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(markVoucherAsRedeemed_args.class, metaDataMap);
11149
    }
11150
 
11151
    public markVoucherAsRedeemed_args() {
11152
    }
11153
 
11154
    public markVoucherAsRedeemed_args(
11155
      String voucherCode,
11156
      long redeemedOn)
11157
    {
11158
      this();
11159
      this.voucherCode = voucherCode;
11160
      this.redeemedOn = redeemedOn;
11161
      setRedeemedOnIsSet(true);
11162
    }
11163
 
11164
    /**
11165
     * Performs a deep copy on <i>other</i>.
11166
     */
11167
    public markVoucherAsRedeemed_args(markVoucherAsRedeemed_args other) {
11168
      __isset_bit_vector.clear();
11169
      __isset_bit_vector.or(other.__isset_bit_vector);
11170
      if (other.isSetVoucherCode()) {
11171
        this.voucherCode = other.voucherCode;
11172
      }
11173
      this.redeemedOn = other.redeemedOn;
11174
    }
11175
 
11176
    public markVoucherAsRedeemed_args deepCopy() {
11177
      return new markVoucherAsRedeemed_args(this);
11178
    }
11179
 
11180
    @Override
11181
    public void clear() {
11182
      this.voucherCode = null;
11183
      setRedeemedOnIsSet(false);
11184
      this.redeemedOn = 0;
11185
    }
11186
 
11187
    public String getVoucherCode() {
11188
      return this.voucherCode;
11189
    }
11190
 
11191
    public void setVoucherCode(String voucherCode) {
11192
      this.voucherCode = voucherCode;
11193
    }
11194
 
11195
    public void unsetVoucherCode() {
11196
      this.voucherCode = null;
11197
    }
11198
 
11199
    /** Returns true if field voucherCode is set (has been assigned a value) and false otherwise */
11200
    public boolean isSetVoucherCode() {
11201
      return this.voucherCode != null;
11202
    }
11203
 
11204
    public void setVoucherCodeIsSet(boolean value) {
11205
      if (!value) {
11206
        this.voucherCode = null;
11207
      }
11208
    }
11209
 
11210
    public long getRedeemedOn() {
11211
      return this.redeemedOn;
11212
    }
11213
 
11214
    public void setRedeemedOn(long redeemedOn) {
11215
      this.redeemedOn = redeemedOn;
11216
      setRedeemedOnIsSet(true);
11217
    }
11218
 
11219
    public void unsetRedeemedOn() {
11220
      __isset_bit_vector.clear(__REDEEMEDON_ISSET_ID);
11221
    }
11222
 
11223
    /** Returns true if field redeemedOn is set (has been assigned a value) and false otherwise */
11224
    public boolean isSetRedeemedOn() {
11225
      return __isset_bit_vector.get(__REDEEMEDON_ISSET_ID);
11226
    }
11227
 
11228
    public void setRedeemedOnIsSet(boolean value) {
11229
      __isset_bit_vector.set(__REDEEMEDON_ISSET_ID, value);
11230
    }
11231
 
11232
    public void setFieldValue(_Fields field, Object value) {
11233
      switch (field) {
11234
      case VOUCHER_CODE:
11235
        if (value == null) {
11236
          unsetVoucherCode();
11237
        } else {
11238
          setVoucherCode((String)value);
11239
        }
11240
        break;
11241
 
11242
      case REDEEMED_ON:
11243
        if (value == null) {
11244
          unsetRedeemedOn();
11245
        } else {
11246
          setRedeemedOn((Long)value);
11247
        }
11248
        break;
11249
 
11250
      }
11251
    }
11252
 
11253
    public Object getFieldValue(_Fields field) {
11254
      switch (field) {
11255
      case VOUCHER_CODE:
11256
        return getVoucherCode();
11257
 
11258
      case REDEEMED_ON:
11259
        return Long.valueOf(getRedeemedOn());
11260
 
11261
      }
11262
      throw new IllegalStateException();
11263
    }
11264
 
11265
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
11266
    public boolean isSet(_Fields field) {
11267
      if (field == null) {
11268
        throw new IllegalArgumentException();
11269
      }
11270
 
11271
      switch (field) {
11272
      case VOUCHER_CODE:
11273
        return isSetVoucherCode();
11274
      case REDEEMED_ON:
11275
        return isSetRedeemedOn();
11276
      }
11277
      throw new IllegalStateException();
11278
    }
11279
 
11280
    @Override
11281
    public boolean equals(Object that) {
11282
      if (that == null)
11283
        return false;
11284
      if (that instanceof markVoucherAsRedeemed_args)
11285
        return this.equals((markVoucherAsRedeemed_args)that);
11286
      return false;
11287
    }
11288
 
11289
    public boolean equals(markVoucherAsRedeemed_args that) {
11290
      if (that == null)
11291
        return false;
11292
 
11293
      boolean this_present_voucherCode = true && this.isSetVoucherCode();
11294
      boolean that_present_voucherCode = true && that.isSetVoucherCode();
11295
      if (this_present_voucherCode || that_present_voucherCode) {
11296
        if (!(this_present_voucherCode && that_present_voucherCode))
11297
          return false;
11298
        if (!this.voucherCode.equals(that.voucherCode))
11299
          return false;
11300
      }
11301
 
11302
      boolean this_present_redeemedOn = true;
11303
      boolean that_present_redeemedOn = true;
11304
      if (this_present_redeemedOn || that_present_redeemedOn) {
11305
        if (!(this_present_redeemedOn && that_present_redeemedOn))
11306
          return false;
11307
        if (this.redeemedOn != that.redeemedOn)
11308
          return false;
11309
      }
11310
 
11311
      return true;
11312
    }
11313
 
11314
    @Override
11315
    public int hashCode() {
11316
      return 0;
11317
    }
11318
 
11319
    public int compareTo(markVoucherAsRedeemed_args other) {
11320
      if (!getClass().equals(other.getClass())) {
11321
        return getClass().getName().compareTo(other.getClass().getName());
11322
      }
11323
 
11324
      int lastComparison = 0;
11325
      markVoucherAsRedeemed_args typedOther = (markVoucherAsRedeemed_args)other;
11326
 
11327
      lastComparison = Boolean.valueOf(isSetVoucherCode()).compareTo(typedOther.isSetVoucherCode());
11328
      if (lastComparison != 0) {
11329
        return lastComparison;
11330
      }
11331
      if (isSetVoucherCode()) {
11332
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.voucherCode, typedOther.voucherCode);
11333
        if (lastComparison != 0) {
11334
          return lastComparison;
11335
        }
11336
      }
11337
      lastComparison = Boolean.valueOf(isSetRedeemedOn()).compareTo(typedOther.isSetRedeemedOn());
11338
      if (lastComparison != 0) {
11339
        return lastComparison;
11340
      }
11341
      if (isSetRedeemedOn()) {
11342
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.redeemedOn, typedOther.redeemedOn);
11343
        if (lastComparison != 0) {
11344
          return lastComparison;
11345
        }
11346
      }
11347
      return 0;
11348
    }
11349
 
11350
    public _Fields fieldForId(int fieldId) {
11351
      return _Fields.findByThriftId(fieldId);
11352
    }
11353
 
11354
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
11355
      org.apache.thrift.protocol.TField field;
11356
      iprot.readStructBegin();
11357
      while (true)
11358
      {
11359
        field = iprot.readFieldBegin();
11360
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
11361
          break;
11362
        }
11363
        switch (field.id) {
11364
          case 1: // VOUCHER_CODE
11365
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
11366
              this.voucherCode = iprot.readString();
11367
            } else { 
11368
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11369
            }
11370
            break;
11371
          case 2: // REDEEMED_ON
11372
            if (field.type == org.apache.thrift.protocol.TType.I64) {
11373
              this.redeemedOn = iprot.readI64();
11374
              setRedeemedOnIsSet(true);
11375
            } else { 
11376
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11377
            }
11378
            break;
11379
          default:
11380
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11381
        }
11382
        iprot.readFieldEnd();
11383
      }
11384
      iprot.readStructEnd();
11385
      validate();
11386
    }
11387
 
11388
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
11389
      validate();
11390
 
11391
      oprot.writeStructBegin(STRUCT_DESC);
11392
      if (this.voucherCode != null) {
11393
        oprot.writeFieldBegin(VOUCHER_CODE_FIELD_DESC);
11394
        oprot.writeString(this.voucherCode);
11395
        oprot.writeFieldEnd();
11396
      }
11397
      oprot.writeFieldBegin(REDEEMED_ON_FIELD_DESC);
11398
      oprot.writeI64(this.redeemedOn);
11399
      oprot.writeFieldEnd();
11400
      oprot.writeFieldStop();
11401
      oprot.writeStructEnd();
11402
    }
11403
 
11404
    @Override
11405
    public String toString() {
11406
      StringBuilder sb = new StringBuilder("markVoucherAsRedeemed_args(");
11407
      boolean first = true;
11408
 
11409
      sb.append("voucherCode:");
11410
      if (this.voucherCode == null) {
11411
        sb.append("null");
11412
      } else {
11413
        sb.append(this.voucherCode);
11414
      }
11415
      first = false;
11416
      if (!first) sb.append(", ");
11417
      sb.append("redeemedOn:");
11418
      sb.append(this.redeemedOn);
11419
      first = false;
11420
      sb.append(")");
11421
      return sb.toString();
11422
    }
11423
 
11424
    public void validate() throws org.apache.thrift.TException {
11425
      // check for required fields
11426
    }
11427
 
11428
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
11429
      try {
11430
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
11431
      } catch (org.apache.thrift.TException te) {
11432
        throw new java.io.IOException(te);
11433
      }
11434
    }
11435
 
11436
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
11437
      try {
11438
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
11439
        __isset_bit_vector = new BitSet(1);
11440
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
11441
      } catch (org.apache.thrift.TException te) {
11442
        throw new java.io.IOException(te);
11443
      }
11444
    }
11445
 
11446
  }
11447
 
11448
  public static class markVoucherAsRedeemed_result implements org.apache.thrift.TBase<markVoucherAsRedeemed_result, markVoucherAsRedeemed_result._Fields>, java.io.Serializable, Cloneable   {
11449
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("markVoucherAsRedeemed_result");
11450
 
11451
    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);
11452
 
11453
    private boolean success; // required
11454
 
11455
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
11456
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
11457
      SUCCESS((short)0, "success");
11458
 
11459
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
11460
 
11461
      static {
11462
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
11463
          byName.put(field.getFieldName(), field);
11464
        }
11465
      }
11466
 
11467
      /**
11468
       * Find the _Fields constant that matches fieldId, or null if its not found.
11469
       */
11470
      public static _Fields findByThriftId(int fieldId) {
11471
        switch(fieldId) {
11472
          case 0: // SUCCESS
11473
            return SUCCESS;
11474
          default:
11475
            return null;
11476
        }
11477
      }
11478
 
11479
      /**
11480
       * Find the _Fields constant that matches fieldId, throwing an exception
11481
       * if it is not found.
11482
       */
11483
      public static _Fields findByThriftIdOrThrow(int fieldId) {
11484
        _Fields fields = findByThriftId(fieldId);
11485
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
11486
        return fields;
11487
      }
11488
 
11489
      /**
11490
       * Find the _Fields constant that matches name, or null if its not found.
11491
       */
11492
      public static _Fields findByName(String name) {
11493
        return byName.get(name);
11494
      }
11495
 
11496
      private final short _thriftId;
11497
      private final String _fieldName;
11498
 
11499
      _Fields(short thriftId, String fieldName) {
11500
        _thriftId = thriftId;
11501
        _fieldName = fieldName;
11502
      }
11503
 
11504
      public short getThriftFieldId() {
11505
        return _thriftId;
11506
      }
11507
 
11508
      public String getFieldName() {
11509
        return _fieldName;
11510
      }
11511
    }
11512
 
11513
    // isset id assignments
11514
    private static final int __SUCCESS_ISSET_ID = 0;
11515
    private BitSet __isset_bit_vector = new BitSet(1);
11516
 
11517
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
11518
    static {
11519
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
11520
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11521
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
11522
      metaDataMap = Collections.unmodifiableMap(tmpMap);
11523
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(markVoucherAsRedeemed_result.class, metaDataMap);
11524
    }
11525
 
11526
    public markVoucherAsRedeemed_result() {
11527
    }
11528
 
11529
    public markVoucherAsRedeemed_result(
11530
      boolean success)
11531
    {
11532
      this();
11533
      this.success = success;
11534
      setSuccessIsSet(true);
11535
    }
11536
 
11537
    /**
11538
     * Performs a deep copy on <i>other</i>.
11539
     */
11540
    public markVoucherAsRedeemed_result(markVoucherAsRedeemed_result other) {
11541
      __isset_bit_vector.clear();
11542
      __isset_bit_vector.or(other.__isset_bit_vector);
11543
      this.success = other.success;
11544
    }
11545
 
11546
    public markVoucherAsRedeemed_result deepCopy() {
11547
      return new markVoucherAsRedeemed_result(this);
11548
    }
11549
 
11550
    @Override
11551
    public void clear() {
11552
      setSuccessIsSet(false);
11553
      this.success = false;
11554
    }
11555
 
11556
    public boolean isSuccess() {
11557
      return this.success;
11558
    }
11559
 
11560
    public void setSuccess(boolean success) {
11561
      this.success = success;
11562
      setSuccessIsSet(true);
11563
    }
11564
 
11565
    public void unsetSuccess() {
11566
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
11567
    }
11568
 
11569
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
11570
    public boolean isSetSuccess() {
11571
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
11572
    }
11573
 
11574
    public void setSuccessIsSet(boolean value) {
11575
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
11576
    }
11577
 
11578
    public void setFieldValue(_Fields field, Object value) {
11579
      switch (field) {
11580
      case SUCCESS:
11581
        if (value == null) {
11582
          unsetSuccess();
11583
        } else {
11584
          setSuccess((Boolean)value);
11585
        }
11586
        break;
11587
 
11588
      }
11589
    }
11590
 
11591
    public Object getFieldValue(_Fields field) {
11592
      switch (field) {
11593
      case SUCCESS:
11594
        return Boolean.valueOf(isSuccess());
11595
 
11596
      }
11597
      throw new IllegalStateException();
11598
    }
11599
 
11600
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
11601
    public boolean isSet(_Fields field) {
11602
      if (field == null) {
11603
        throw new IllegalArgumentException();
11604
      }
11605
 
11606
      switch (field) {
11607
      case SUCCESS:
11608
        return isSetSuccess();
11609
      }
11610
      throw new IllegalStateException();
11611
    }
11612
 
11613
    @Override
11614
    public boolean equals(Object that) {
11615
      if (that == null)
11616
        return false;
11617
      if (that instanceof markVoucherAsRedeemed_result)
11618
        return this.equals((markVoucherAsRedeemed_result)that);
11619
      return false;
11620
    }
11621
 
11622
    public boolean equals(markVoucherAsRedeemed_result that) {
11623
      if (that == null)
11624
        return false;
11625
 
11626
      boolean this_present_success = true;
11627
      boolean that_present_success = true;
11628
      if (this_present_success || that_present_success) {
11629
        if (!(this_present_success && that_present_success))
11630
          return false;
11631
        if (this.success != that.success)
11632
          return false;
11633
      }
11634
 
11635
      return true;
11636
    }
11637
 
11638
    @Override
11639
    public int hashCode() {
11640
      return 0;
11641
    }
11642
 
11643
    public int compareTo(markVoucherAsRedeemed_result other) {
11644
      if (!getClass().equals(other.getClass())) {
11645
        return getClass().getName().compareTo(other.getClass().getName());
11646
      }
11647
 
11648
      int lastComparison = 0;
11649
      markVoucherAsRedeemed_result typedOther = (markVoucherAsRedeemed_result)other;
11650
 
11651
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
11652
      if (lastComparison != 0) {
11653
        return lastComparison;
11654
      }
11655
      if (isSetSuccess()) {
11656
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
11657
        if (lastComparison != 0) {
11658
          return lastComparison;
11659
        }
11660
      }
11661
      return 0;
11662
    }
11663
 
11664
    public _Fields fieldForId(int fieldId) {
11665
      return _Fields.findByThriftId(fieldId);
11666
    }
11667
 
11668
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
11669
      org.apache.thrift.protocol.TField field;
11670
      iprot.readStructBegin();
11671
      while (true)
11672
      {
11673
        field = iprot.readFieldBegin();
11674
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
11675
          break;
11676
        }
11677
        switch (field.id) {
11678
          case 0: // SUCCESS
11679
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
11680
              this.success = iprot.readBool();
11681
              setSuccessIsSet(true);
11682
            } else { 
11683
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11684
            }
11685
            break;
11686
          default:
11687
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11688
        }
11689
        iprot.readFieldEnd();
11690
      }
11691
      iprot.readStructEnd();
11692
      validate();
11693
    }
11694
 
11695
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
11696
      oprot.writeStructBegin(STRUCT_DESC);
11697
 
11698
      if (this.isSetSuccess()) {
11699
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
11700
        oprot.writeBool(this.success);
11701
        oprot.writeFieldEnd();
11702
      }
11703
      oprot.writeFieldStop();
11704
      oprot.writeStructEnd();
11705
    }
11706
 
11707
    @Override
11708
    public String toString() {
11709
      StringBuilder sb = new StringBuilder("markVoucherAsRedeemed_result(");
11710
      boolean first = true;
11711
 
11712
      sb.append("success:");
11713
      sb.append(this.success);
11714
      first = false;
11715
      sb.append(")");
11716
      return sb.toString();
11717
    }
11718
 
11719
    public void validate() throws org.apache.thrift.TException {
11720
      // check for required fields
11721
    }
11722
 
11723
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
11724
      try {
11725
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
11726
      } catch (org.apache.thrift.TException te) {
11727
        throw new java.io.IOException(te);
11728
      }
11729
    }
11730
 
11731
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
11732
      try {
11733
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
11734
      } catch (org.apache.thrift.TException te) {
11735
        throw new java.io.IOException(te);
11736
      }
11737
    }
11738
 
11739
  }
11740
 
1982 varun.gupt 11741
}