Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
1982 varun.gupt 1
/**
3430 rajveer 2
 * Autogenerated by Thrift Compiler (0.7.0)
1982 varun.gupt 3
 *
4
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
 */
6
package in.shop2020.model.v1.user;
7
 
8
import java.util.List;
9
import java.util.ArrayList;
10
import java.util.Map;
11
import java.util.HashMap;
12
import java.util.EnumMap;
13
import java.util.Set;
14
import java.util.HashSet;
15
import java.util.EnumSet;
16
import java.util.Collections;
17
import java.util.BitSet;
3430 rajveer 18
import java.nio.ByteBuffer;
1982 varun.gupt 19
import java.util.Arrays;
20
import org.slf4j.Logger;
21
import org.slf4j.LoggerFactory;
22
 
23
public class PromotionService {
24
 
25
  /**
26
   * Promotion Service
27
   */
3374 rajveer 28
  public interface Iface extends in.shop2020.generic.GenericService.Iface {
1982 varun.gupt 29
 
3430 rajveer 30
    public void createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 31
 
6301 amit.gupta 32
    public Coupon getCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException;
33
 
34
    public boolean isGiftVoucher(String couponCode) throws PromotionException, org.apache.thrift.TException;
35
 
3430 rajveer 36
    public List<Promotion> getAllPromotions() throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 37
 
3430 rajveer 38
    public Promotion getPromotionById(long promotionId) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 39
 
3430 rajveer 40
    public void generateCouponsForPromotion(long promotionId, String couponCode) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 41
 
3430 rajveer 42
    public Cart applyCoupon(String couponCode, long cartId) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 43
 
3430 rajveer 44
    public void trackCouponUsage(String couponCode, long transactionId, long userId) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 45
 
3430 rajveer 46
    public long getCouponUsageCountByUser(String couponCode, long userId) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 47
 
3385 varun.gupt 48
    /**
49
     * Returns a list of active coupons
50
     */
3430 rajveer 51
    public List<Coupon> getActiveCoupons() throws PromotionException, org.apache.thrift.TException;
3385 varun.gupt 52
 
53
    /**
6250 amit.gupta 54
     * Creates a coupon and returns couponcode if successfully created
55
     * 
56
     * @param promotionId
57
     * @param endOn
58
     * @param email
59
     * @param amount
60
     * @param usage
61
     */
62
    public String createCoupon(long promotionId, long endOn, String email, long amount, long usage) throws PromotionException, org.apache.thrift.TException;
63
 
64
    /**
3385 varun.gupt 65
     * Returns the count of successful payments done using a given coupon
66
     * 
67
     * @param couponCode
68
     */
3430 rajveer 69
    public long getSuccessfulPaymentCountForCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException;
3385 varun.gupt 70
 
71
    /**
72
     * Returns the doc string of the rule module
73
     * 
74
     * @param ruleName
75
     */
3430 rajveer 76
    public String getRuleDocString(String ruleName) throws org.apache.thrift.TException;
3385 varun.gupt 77
 
4189 varun.gupt 78
    public List<ItemCouponDiscount> getItemDiscountMap(List<Long> itemIds) throws PromotionException, org.apache.thrift.TException;
79
 
4494 varun.gupt 80
    public Map<String,Double> getDiscountsForEntity(long entityId) throws org.apache.thrift.TException;
81
 
5469 rajveer 82
    public void addVoucher(Voucher voucher) throws org.apache.thrift.TException;
83
 
84
    public Voucher assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount) throws org.apache.thrift.TException;
85
 
86
    public boolean markVoucherAsRedeemed(String voucherCode, long redeemedOn) throws org.apache.thrift.TException;
87
 
1982 varun.gupt 88
  }
89
 
3430 rajveer 90
  public interface AsyncIface extends in.shop2020.generic.GenericService .AsyncIface {
1982 varun.gupt 91
 
3430 rajveer 92
    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 93
 
6301 amit.gupta 94
    public void getCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getCoupon_call> resultHandler) throws org.apache.thrift.TException;
95
 
96
    public void isGiftVoucher(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.isGiftVoucher_call> resultHandler) throws org.apache.thrift.TException;
97
 
3430 rajveer 98
    public void getAllPromotions(org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getAllPromotions_call> resultHandler) throws org.apache.thrift.TException;
99
 
100
    public void getPromotionById(long promotionId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getPromotionById_call> resultHandler) throws org.apache.thrift.TException;
101
 
102
    public void generateCouponsForPromotion(long promotionId, String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.generateCouponsForPromotion_call> resultHandler) throws org.apache.thrift.TException;
103
 
104
    public void applyCoupon(String couponCode, long cartId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.applyCoupon_call> resultHandler) throws org.apache.thrift.TException;
105
 
106
    public void trackCouponUsage(String couponCode, long transactionId, long userId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.trackCouponUsage_call> resultHandler) throws org.apache.thrift.TException;
107
 
108
    public void getCouponUsageCountByUser(String couponCode, long userId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getCouponUsageCountByUser_call> resultHandler) throws org.apache.thrift.TException;
109
 
110
    public void getActiveCoupons(org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getActiveCoupons_call> resultHandler) throws org.apache.thrift.TException;
111
 
6250 amit.gupta 112
    public void createCoupon(long promotionId, long endOn, String email, long amount, long usage, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.createCoupon_call> resultHandler) throws org.apache.thrift.TException;
113
 
3430 rajveer 114
    public void getSuccessfulPaymentCountForCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getSuccessfulPaymentCountForCoupon_call> resultHandler) throws org.apache.thrift.TException;
115
 
116
    public void getRuleDocString(String ruleName, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getRuleDocString_call> resultHandler) throws org.apache.thrift.TException;
117
 
4189 varun.gupt 118
    public void getItemDiscountMap(List<Long> itemIds, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getItemDiscountMap_call> resultHandler) throws org.apache.thrift.TException;
119
 
4494 varun.gupt 120
    public void getDiscountsForEntity(long entityId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getDiscountsForEntity_call> resultHandler) throws org.apache.thrift.TException;
121
 
5469 rajveer 122
    public void addVoucher(Voucher voucher, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.addVoucher_call> resultHandler) throws org.apache.thrift.TException;
123
 
124
    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;
125
 
126
    public void markVoucherAsRedeemed(String voucherCode, long redeemedOn, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.markVoucherAsRedeemed_call> resultHandler) throws org.apache.thrift.TException;
127
 
3430 rajveer 128
  }
129
 
130
  public static class Client extends in.shop2020.generic.GenericService.Client implements Iface {
131
    public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> {
132
      public Factory() {}
133
      public Client getClient(org.apache.thrift.protocol.TProtocol prot) {
134
        return new Client(prot);
135
      }
136
      public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
137
        return new Client(iprot, oprot);
138
      }
1982 varun.gupt 139
    }
140
 
3430 rajveer 141
    public Client(org.apache.thrift.protocol.TProtocol prot)
1982 varun.gupt 142
    {
3430 rajveer 143
      super(prot, prot);
1982 varun.gupt 144
    }
145
 
3430 rajveer 146
    public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
147
      super(iprot, oprot);
1982 varun.gupt 148
    }
149
 
3430 rajveer 150
    public void createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 151
    {
152
      send_createPromotion(name, ruleExecutionSrc, startOn, endOn);
153
      recv_createPromotion();
154
    }
155
 
3430 rajveer 156
    public void send_createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn) throws org.apache.thrift.TException
1982 varun.gupt 157
    {
158
      createPromotion_args args = new createPromotion_args();
3430 rajveer 159
      args.setName(name);
160
      args.setRuleExecutionSrc(ruleExecutionSrc);
161
      args.setStartOn(startOn);
162
      args.setEndOn(endOn);
163
      sendBase("createPromotion", args);
1982 varun.gupt 164
    }
165
 
3430 rajveer 166
    public void recv_createPromotion() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 167
    {
168
      createPromotion_result result = new createPromotion_result();
3430 rajveer 169
      receiveBase(result, "createPromotion");
1982 varun.gupt 170
      if (result.pex != null) {
171
        throw result.pex;
172
      }
173
      return;
174
    }
175
 
6301 amit.gupta 176
    public Coupon getCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException
177
    {
178
      send_getCoupon(couponCode);
179
      return recv_getCoupon();
180
    }
181
 
182
    public void send_getCoupon(String couponCode) throws org.apache.thrift.TException
183
    {
184
      getCoupon_args args = new getCoupon_args();
185
      args.setCouponCode(couponCode);
186
      sendBase("getCoupon", args);
187
    }
188
 
189
    public Coupon recv_getCoupon() throws PromotionException, org.apache.thrift.TException
190
    {
191
      getCoupon_result result = new getCoupon_result();
192
      receiveBase(result, "getCoupon");
193
      if (result.isSetSuccess()) {
194
        return result.success;
195
      }
196
      if (result.pex != null) {
197
        throw result.pex;
198
      }
199
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCoupon failed: unknown result");
200
    }
201
 
202
    public boolean isGiftVoucher(String couponCode) throws PromotionException, org.apache.thrift.TException
203
    {
204
      send_isGiftVoucher(couponCode);
205
      return recv_isGiftVoucher();
206
    }
207
 
208
    public void send_isGiftVoucher(String couponCode) throws org.apache.thrift.TException
209
    {
210
      isGiftVoucher_args args = new isGiftVoucher_args();
211
      args.setCouponCode(couponCode);
212
      sendBase("isGiftVoucher", args);
213
    }
214
 
215
    public boolean recv_isGiftVoucher() throws PromotionException, org.apache.thrift.TException
216
    {
217
      isGiftVoucher_result result = new isGiftVoucher_result();
218
      receiveBase(result, "isGiftVoucher");
219
      if (result.isSetSuccess()) {
220
        return result.success;
221
      }
222
      if (result.pex != null) {
223
        throw result.pex;
224
      }
225
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "isGiftVoucher failed: unknown result");
226
    }
227
 
3430 rajveer 228
    public List<Promotion> getAllPromotions() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 229
    {
230
      send_getAllPromotions();
231
      return recv_getAllPromotions();
232
    }
233
 
3430 rajveer 234
    public void send_getAllPromotions() throws org.apache.thrift.TException
1982 varun.gupt 235
    {
236
      getAllPromotions_args args = new getAllPromotions_args();
3430 rajveer 237
      sendBase("getAllPromotions", args);
1982 varun.gupt 238
    }
239
 
3430 rajveer 240
    public List<Promotion> recv_getAllPromotions() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 241
    {
242
      getAllPromotions_result result = new getAllPromotions_result();
3430 rajveer 243
      receiveBase(result, "getAllPromotions");
1982 varun.gupt 244
      if (result.isSetSuccess()) {
245
        return result.success;
246
      }
247
      if (result.pex != null) {
248
        throw result.pex;
249
      }
3430 rajveer 250
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllPromotions failed: unknown result");
1982 varun.gupt 251
    }
252
 
3430 rajveer 253
    public Promotion getPromotionById(long promotionId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 254
    {
255
      send_getPromotionById(promotionId);
256
      return recv_getPromotionById();
257
    }
258
 
3430 rajveer 259
    public void send_getPromotionById(long promotionId) throws org.apache.thrift.TException
1982 varun.gupt 260
    {
261
      getPromotionById_args args = new getPromotionById_args();
3430 rajveer 262
      args.setPromotionId(promotionId);
263
      sendBase("getPromotionById", args);
1982 varun.gupt 264
    }
265
 
3430 rajveer 266
    public Promotion recv_getPromotionById() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 267
    {
268
      getPromotionById_result result = new getPromotionById_result();
3430 rajveer 269
      receiveBase(result, "getPromotionById");
1982 varun.gupt 270
      if (result.isSetSuccess()) {
271
        return result.success;
272
      }
273
      if (result.pex != null) {
274
        throw result.pex;
275
      }
3430 rajveer 276
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPromotionById failed: unknown result");
1982 varun.gupt 277
    }
278
 
3430 rajveer 279
    public void generateCouponsForPromotion(long promotionId, String couponCode) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 280
    {
281
      send_generateCouponsForPromotion(promotionId, couponCode);
282
      recv_generateCouponsForPromotion();
283
    }
284
 
3430 rajveer 285
    public void send_generateCouponsForPromotion(long promotionId, String couponCode) throws org.apache.thrift.TException
1982 varun.gupt 286
    {
287
      generateCouponsForPromotion_args args = new generateCouponsForPromotion_args();
3430 rajveer 288
      args.setPromotionId(promotionId);
289
      args.setCouponCode(couponCode);
290
      sendBase("generateCouponsForPromotion", args);
1982 varun.gupt 291
    }
292
 
3430 rajveer 293
    public void recv_generateCouponsForPromotion() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 294
    {
295
      generateCouponsForPromotion_result result = new generateCouponsForPromotion_result();
3430 rajveer 296
      receiveBase(result, "generateCouponsForPromotion");
1982 varun.gupt 297
      if (result.pex != null) {
298
        throw result.pex;
299
      }
300
      return;
301
    }
302
 
3430 rajveer 303
    public Cart applyCoupon(String couponCode, long cartId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 304
    {
305
      send_applyCoupon(couponCode, cartId);
306
      return recv_applyCoupon();
307
    }
308
 
3430 rajveer 309
    public void send_applyCoupon(String couponCode, long cartId) throws org.apache.thrift.TException
1982 varun.gupt 310
    {
311
      applyCoupon_args args = new applyCoupon_args();
3430 rajveer 312
      args.setCouponCode(couponCode);
313
      args.setCartId(cartId);
314
      sendBase("applyCoupon", args);
1982 varun.gupt 315
    }
316
 
3430 rajveer 317
    public Cart recv_applyCoupon() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 318
    {
319
      applyCoupon_result result = new applyCoupon_result();
3430 rajveer 320
      receiveBase(result, "applyCoupon");
1982 varun.gupt 321
      if (result.isSetSuccess()) {
322
        return result.success;
323
      }
324
      if (result.pex != null) {
325
        throw result.pex;
326
      }
3430 rajveer 327
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "applyCoupon failed: unknown result");
1982 varun.gupt 328
    }
329
 
3430 rajveer 330
    public void trackCouponUsage(String couponCode, long transactionId, long userId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 331
    {
332
      send_trackCouponUsage(couponCode, transactionId, userId);
333
      recv_trackCouponUsage();
334
    }
335
 
3430 rajveer 336
    public void send_trackCouponUsage(String couponCode, long transactionId, long userId) throws org.apache.thrift.TException
1982 varun.gupt 337
    {
338
      trackCouponUsage_args args = new trackCouponUsage_args();
3430 rajveer 339
      args.setCouponCode(couponCode);
340
      args.setTransactionId(transactionId);
341
      args.setUserId(userId);
342
      sendBase("trackCouponUsage", args);
1982 varun.gupt 343
    }
344
 
3430 rajveer 345
    public void recv_trackCouponUsage() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 346
    {
347
      trackCouponUsage_result result = new trackCouponUsage_result();
3430 rajveer 348
      receiveBase(result, "trackCouponUsage");
1982 varun.gupt 349
      if (result.pex != null) {
350
        throw result.pex;
351
      }
352
      return;
353
    }
354
 
3430 rajveer 355
    public long getCouponUsageCountByUser(String couponCode, long userId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 356
    {
357
      send_getCouponUsageCountByUser(couponCode, userId);
358
      return recv_getCouponUsageCountByUser();
359
    }
360
 
3430 rajveer 361
    public void send_getCouponUsageCountByUser(String couponCode, long userId) throws org.apache.thrift.TException
1982 varun.gupt 362
    {
363
      getCouponUsageCountByUser_args args = new getCouponUsageCountByUser_args();
3430 rajveer 364
      args.setCouponCode(couponCode);
365
      args.setUserId(userId);
366
      sendBase("getCouponUsageCountByUser", args);
1982 varun.gupt 367
    }
368
 
3430 rajveer 369
    public long recv_getCouponUsageCountByUser() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 370
    {
371
      getCouponUsageCountByUser_result result = new getCouponUsageCountByUser_result();
3430 rajveer 372
      receiveBase(result, "getCouponUsageCountByUser");
1982 varun.gupt 373
      if (result.isSetSuccess()) {
374
        return result.success;
375
      }
376
      if (result.pex != null) {
377
        throw result.pex;
378
      }
3430 rajveer 379
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCouponUsageCountByUser failed: unknown result");
1982 varun.gupt 380
    }
381
 
3430 rajveer 382
    public List<Coupon> getActiveCoupons() throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 383
    {
384
      send_getActiveCoupons();
385
      return recv_getActiveCoupons();
386
    }
387
 
3430 rajveer 388
    public void send_getActiveCoupons() throws org.apache.thrift.TException
3385 varun.gupt 389
    {
390
      getActiveCoupons_args args = new getActiveCoupons_args();
3430 rajveer 391
      sendBase("getActiveCoupons", args);
3385 varun.gupt 392
    }
393
 
3430 rajveer 394
    public List<Coupon> recv_getActiveCoupons() throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 395
    {
396
      getActiveCoupons_result result = new getActiveCoupons_result();
3430 rajveer 397
      receiveBase(result, "getActiveCoupons");
3385 varun.gupt 398
      if (result.isSetSuccess()) {
399
        return result.success;
400
      }
401
      if (result.pex != null) {
402
        throw result.pex;
403
      }
3430 rajveer 404
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getActiveCoupons failed: unknown result");
3385 varun.gupt 405
    }
406
 
6250 amit.gupta 407
    public String createCoupon(long promotionId, long endOn, String email, long amount, long usage) throws PromotionException, org.apache.thrift.TException
408
    {
409
      send_createCoupon(promotionId, endOn, email, amount, usage);
410
      return recv_createCoupon();
411
    }
412
 
413
    public void send_createCoupon(long promotionId, long endOn, String email, long amount, long usage) throws org.apache.thrift.TException
414
    {
415
      createCoupon_args args = new createCoupon_args();
416
      args.setPromotionId(promotionId);
417
      args.setEndOn(endOn);
418
      args.setEmail(email);
419
      args.setAmount(amount);
420
      args.setUsage(usage);
421
      sendBase("createCoupon", args);
422
    }
423
 
424
    public String recv_createCoupon() throws PromotionException, org.apache.thrift.TException
425
    {
426
      createCoupon_result result = new createCoupon_result();
427
      receiveBase(result, "createCoupon");
428
      if (result.isSetSuccess()) {
429
        return result.success;
430
      }
431
      if (result.pex != null) {
432
        throw result.pex;
433
      }
434
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "createCoupon failed: unknown result");
435
    }
436
 
3430 rajveer 437
    public long getSuccessfulPaymentCountForCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 438
    {
439
      send_getSuccessfulPaymentCountForCoupon(couponCode);
440
      return recv_getSuccessfulPaymentCountForCoupon();
441
    }
442
 
3430 rajveer 443
    public void send_getSuccessfulPaymentCountForCoupon(String couponCode) throws org.apache.thrift.TException
3385 varun.gupt 444
    {
445
      getSuccessfulPaymentCountForCoupon_args args = new getSuccessfulPaymentCountForCoupon_args();
3430 rajveer 446
      args.setCouponCode(couponCode);
447
      sendBase("getSuccessfulPaymentCountForCoupon", args);
3385 varun.gupt 448
    }
449
 
3430 rajveer 450
    public long recv_getSuccessfulPaymentCountForCoupon() throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 451
    {
452
      getSuccessfulPaymentCountForCoupon_result result = new getSuccessfulPaymentCountForCoupon_result();
3430 rajveer 453
      receiveBase(result, "getSuccessfulPaymentCountForCoupon");
3385 varun.gupt 454
      if (result.isSetSuccess()) {
455
        return result.success;
456
      }
457
      if (result.pex != null) {
458
        throw result.pex;
459
      }
3430 rajveer 460
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getSuccessfulPaymentCountForCoupon failed: unknown result");
3385 varun.gupt 461
    }
462
 
3430 rajveer 463
    public String getRuleDocString(String ruleName) throws org.apache.thrift.TException
3385 varun.gupt 464
    {
465
      send_getRuleDocString(ruleName);
466
      return recv_getRuleDocString();
467
    }
468
 
3430 rajveer 469
    public void send_getRuleDocString(String ruleName) throws org.apache.thrift.TException
3385 varun.gupt 470
    {
471
      getRuleDocString_args args = new getRuleDocString_args();
3430 rajveer 472
      args.setRuleName(ruleName);
473
      sendBase("getRuleDocString", args);
3385 varun.gupt 474
    }
475
 
3430 rajveer 476
    public String recv_getRuleDocString() throws org.apache.thrift.TException
3385 varun.gupt 477
    {
478
      getRuleDocString_result result = new getRuleDocString_result();
3430 rajveer 479
      receiveBase(result, "getRuleDocString");
3385 varun.gupt 480
      if (result.isSetSuccess()) {
481
        return result.success;
482
      }
3430 rajveer 483
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getRuleDocString failed: unknown result");
3385 varun.gupt 484
    }
485
 
4189 varun.gupt 486
    public List<ItemCouponDiscount> getItemDiscountMap(List<Long> itemIds) throws PromotionException, org.apache.thrift.TException
487
    {
488
      send_getItemDiscountMap(itemIds);
489
      return recv_getItemDiscountMap();
490
    }
491
 
492
    public void send_getItemDiscountMap(List<Long> itemIds) throws org.apache.thrift.TException
493
    {
494
      getItemDiscountMap_args args = new getItemDiscountMap_args();
495
      args.setItemIds(itemIds);
496
      sendBase("getItemDiscountMap", args);
497
    }
498
 
499
    public List<ItemCouponDiscount> recv_getItemDiscountMap() throws PromotionException, org.apache.thrift.TException
500
    {
501
      getItemDiscountMap_result result = new getItemDiscountMap_result();
502
      receiveBase(result, "getItemDiscountMap");
503
      if (result.isSetSuccess()) {
504
        return result.success;
505
      }
506
      if (result.pex != null) {
507
        throw result.pex;
508
      }
509
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getItemDiscountMap failed: unknown result");
510
    }
511
 
4494 varun.gupt 512
    public Map<String,Double> getDiscountsForEntity(long entityId) throws org.apache.thrift.TException
513
    {
514
      send_getDiscountsForEntity(entityId);
515
      return recv_getDiscountsForEntity();
516
    }
517
 
518
    public void send_getDiscountsForEntity(long entityId) throws org.apache.thrift.TException
519
    {
520
      getDiscountsForEntity_args args = new getDiscountsForEntity_args();
521
      args.setEntityId(entityId);
522
      sendBase("getDiscountsForEntity", args);
523
    }
524
 
525
    public Map<String,Double> recv_getDiscountsForEntity() throws org.apache.thrift.TException
526
    {
527
      getDiscountsForEntity_result result = new getDiscountsForEntity_result();
528
      receiveBase(result, "getDiscountsForEntity");
529
      if (result.isSetSuccess()) {
530
        return result.success;
531
      }
532
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getDiscountsForEntity failed: unknown result");
533
    }
534
 
5469 rajveer 535
    public void addVoucher(Voucher voucher) throws org.apache.thrift.TException
536
    {
537
      send_addVoucher(voucher);
538
      recv_addVoucher();
539
    }
540
 
541
    public void send_addVoucher(Voucher voucher) throws org.apache.thrift.TException
542
    {
543
      addVoucher_args args = new addVoucher_args();
544
      args.setVoucher(voucher);
545
      sendBase("addVoucher", args);
546
    }
547
 
548
    public void recv_addVoucher() throws org.apache.thrift.TException
549
    {
550
      addVoucher_result result = new addVoucher_result();
551
      receiveBase(result, "addVoucher");
552
      return;
553
    }
554
 
555
    public Voucher assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount) throws org.apache.thrift.TException
556
    {
557
      send_assignVoucher(userId, userEmail, voucherType, amount);
558
      return recv_assignVoucher();
559
    }
560
 
561
    public void send_assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount) throws org.apache.thrift.TException
562
    {
563
      assignVoucher_args args = new assignVoucher_args();
564
      args.setUserId(userId);
565
      args.setUserEmail(userEmail);
566
      args.setVoucherType(voucherType);
567
      args.setAmount(amount);
568
      sendBase("assignVoucher", args);
569
    }
570
 
571
    public Voucher recv_assignVoucher() throws org.apache.thrift.TException
572
    {
573
      assignVoucher_result result = new assignVoucher_result();
574
      receiveBase(result, "assignVoucher");
575
      if (result.isSetSuccess()) {
576
        return result.success;
577
      }
578
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "assignVoucher failed: unknown result");
579
    }
580
 
581
    public boolean markVoucherAsRedeemed(String voucherCode, long redeemedOn) throws org.apache.thrift.TException
582
    {
583
      send_markVoucherAsRedeemed(voucherCode, redeemedOn);
584
      return recv_markVoucherAsRedeemed();
585
    }
586
 
587
    public void send_markVoucherAsRedeemed(String voucherCode, long redeemedOn) throws org.apache.thrift.TException
588
    {
589
      markVoucherAsRedeemed_args args = new markVoucherAsRedeemed_args();
590
      args.setVoucherCode(voucherCode);
591
      args.setRedeemedOn(redeemedOn);
592
      sendBase("markVoucherAsRedeemed", args);
593
    }
594
 
595
    public boolean recv_markVoucherAsRedeemed() throws org.apache.thrift.TException
596
    {
597
      markVoucherAsRedeemed_result result = new markVoucherAsRedeemed_result();
598
      receiveBase(result, "markVoucherAsRedeemed");
599
      if (result.isSetSuccess()) {
600
        return result.success;
601
      }
602
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "markVoucherAsRedeemed failed: unknown result");
603
    }
604
 
1982 varun.gupt 605
  }
3430 rajveer 606
  public static class AsyncClient extends in.shop2020.generic.GenericService.AsyncClient implements AsyncIface {
607
    public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
608
      private org.apache.thrift.async.TAsyncClientManager clientManager;
609
      private org.apache.thrift.protocol.TProtocolFactory protocolFactory;
610
      public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) {
611
        this.clientManager = clientManager;
612
        this.protocolFactory = protocolFactory;
613
      }
614
      public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) {
615
        return new AsyncClient(protocolFactory, clientManager, transport);
616
      }
1982 varun.gupt 617
    }
618
 
3430 rajveer 619
    public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) {
620
      super(protocolFactory, clientManager, transport);
621
    }
1982 varun.gupt 622
 
3430 rajveer 623
    public void createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn, org.apache.thrift.async.AsyncMethodCallback<createPromotion_call> resultHandler) throws org.apache.thrift.TException {
624
      checkReady();
625
      createPromotion_call method_call = new createPromotion_call(name, ruleExecutionSrc, startOn, endOn, resultHandler, this, ___protocolFactory, ___transport);
626
      this.___currentMethod = method_call;
627
      ___manager.call(method_call);
1982 varun.gupt 628
    }
629
 
3430 rajveer 630
    public static class createPromotion_call extends org.apache.thrift.async.TAsyncMethodCall {
631
      private String name;
632
      private String ruleExecutionSrc;
633
      private long startOn;
634
      private long endOn;
635
      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 {
636
        super(client, protocolFactory, transport, resultHandler, false);
637
        this.name = name;
638
        this.ruleExecutionSrc = ruleExecutionSrc;
639
        this.startOn = startOn;
640
        this.endOn = endOn;
1982 varun.gupt 641
      }
642
 
3430 rajveer 643
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
644
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createPromotion", org.apache.thrift.protocol.TMessageType.CALL, 0));
1982 varun.gupt 645
        createPromotion_args args = new createPromotion_args();
3430 rajveer 646
        args.setName(name);
647
        args.setRuleExecutionSrc(ruleExecutionSrc);
648
        args.setStartOn(startOn);
649
        args.setEndOn(endOn);
650
        args.write(prot);
651
        prot.writeMessageEnd();
1982 varun.gupt 652
      }
653
 
3430 rajveer 654
      public void getResult() throws PromotionException, org.apache.thrift.TException {
655
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
656
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 657
        }
3430 rajveer 658
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
659
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
660
        (new Client(prot)).recv_createPromotion();
1982 varun.gupt 661
      }
3430 rajveer 662
    }
1982 varun.gupt 663
 
6301 amit.gupta 664
    public void getCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<getCoupon_call> resultHandler) throws org.apache.thrift.TException {
665
      checkReady();
666
      getCoupon_call method_call = new getCoupon_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
667
      this.___currentMethod = method_call;
668
      ___manager.call(method_call);
669
    }
670
 
671
    public static class getCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
672
      private String couponCode;
673
      public getCoupon_call(String couponCode, org.apache.thrift.async.AsyncMethodCallback<getCoupon_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
674
        super(client, protocolFactory, transport, resultHandler, false);
675
        this.couponCode = couponCode;
676
      }
677
 
678
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
679
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
680
        getCoupon_args args = new getCoupon_args();
681
        args.setCouponCode(couponCode);
682
        args.write(prot);
683
        prot.writeMessageEnd();
684
      }
685
 
686
      public Coupon getResult() throws PromotionException, org.apache.thrift.TException {
687
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
688
          throw new IllegalStateException("Method call not finished!");
689
        }
690
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
691
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
692
        return (new Client(prot)).recv_getCoupon();
693
      }
694
    }
695
 
696
    public void isGiftVoucher(String couponCode, org.apache.thrift.async.AsyncMethodCallback<isGiftVoucher_call> resultHandler) throws org.apache.thrift.TException {
697
      checkReady();
698
      isGiftVoucher_call method_call = new isGiftVoucher_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
699
      this.___currentMethod = method_call;
700
      ___manager.call(method_call);
701
    }
702
 
703
    public static class isGiftVoucher_call extends org.apache.thrift.async.TAsyncMethodCall {
704
      private String couponCode;
705
      public isGiftVoucher_call(String couponCode, org.apache.thrift.async.AsyncMethodCallback<isGiftVoucher_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
706
        super(client, protocolFactory, transport, resultHandler, false);
707
        this.couponCode = couponCode;
708
      }
709
 
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("isGiftVoucher", org.apache.thrift.protocol.TMessageType.CALL, 0));
712
        isGiftVoucher_args args = new isGiftVoucher_args();
713
        args.setCouponCode(couponCode);
714
        args.write(prot);
715
        prot.writeMessageEnd();
716
      }
717
 
718
      public boolean getResult() throws PromotionException, org.apache.thrift.TException {
719
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
720
          throw new IllegalStateException("Method call not finished!");
721
        }
722
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
723
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
724
        return (new Client(prot)).recv_isGiftVoucher();
725
      }
726
    }
727
 
3430 rajveer 728
    public void getAllPromotions(org.apache.thrift.async.AsyncMethodCallback<getAllPromotions_call> resultHandler) throws org.apache.thrift.TException {
729
      checkReady();
730
      getAllPromotions_call method_call = new getAllPromotions_call(resultHandler, this, ___protocolFactory, ___transport);
731
      this.___currentMethod = method_call;
732
      ___manager.call(method_call);
1982 varun.gupt 733
    }
734
 
3430 rajveer 735
    public static class getAllPromotions_call extends org.apache.thrift.async.TAsyncMethodCall {
736
      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 {
737
        super(client, protocolFactory, transport, resultHandler, false);
1982 varun.gupt 738
      }
739
 
3430 rajveer 740
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
741
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAllPromotions", org.apache.thrift.protocol.TMessageType.CALL, 0));
742
        getAllPromotions_args args = new getAllPromotions_args();
743
        args.write(prot);
744
        prot.writeMessageEnd();
745
      }
1982 varun.gupt 746
 
3430 rajveer 747
      public List<Promotion> getResult() throws PromotionException, org.apache.thrift.TException {
748
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
749
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 750
        }
3430 rajveer 751
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
752
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
753
        return (new Client(prot)).recv_getAllPromotions();
1982 varun.gupt 754
      }
3430 rajveer 755
    }
1982 varun.gupt 756
 
3430 rajveer 757
    public void getPromotionById(long promotionId, org.apache.thrift.async.AsyncMethodCallback<getPromotionById_call> resultHandler) throws org.apache.thrift.TException {
758
      checkReady();
759
      getPromotionById_call method_call = new getPromotionById_call(promotionId, resultHandler, this, ___protocolFactory, ___transport);
760
      this.___currentMethod = method_call;
761
      ___manager.call(method_call);
1982 varun.gupt 762
    }
763
 
3430 rajveer 764
    public static class getPromotionById_call extends org.apache.thrift.async.TAsyncMethodCall {
765
      private long promotionId;
766
      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 {
767
        super(client, protocolFactory, transport, resultHandler, false);
768
        this.promotionId = promotionId;
1982 varun.gupt 769
      }
770
 
3430 rajveer 771
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
772
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getPromotionById", org.apache.thrift.protocol.TMessageType.CALL, 0));
773
        getPromotionById_args args = new getPromotionById_args();
774
        args.setPromotionId(promotionId);
775
        args.write(prot);
776
        prot.writeMessageEnd();
777
      }
1982 varun.gupt 778
 
3430 rajveer 779
      public Promotion getResult() throws PromotionException, org.apache.thrift.TException {
780
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
781
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 782
        }
3430 rajveer 783
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
784
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
785
        return (new Client(prot)).recv_getPromotionById();
1982 varun.gupt 786
      }
3430 rajveer 787
    }
1982 varun.gupt 788
 
3430 rajveer 789
    public void generateCouponsForPromotion(long promotionId, String couponCode, org.apache.thrift.async.AsyncMethodCallback<generateCouponsForPromotion_call> resultHandler) throws org.apache.thrift.TException {
790
      checkReady();
791
      generateCouponsForPromotion_call method_call = new generateCouponsForPromotion_call(promotionId, couponCode, resultHandler, this, ___protocolFactory, ___transport);
792
      this.___currentMethod = method_call;
793
      ___manager.call(method_call);
1982 varun.gupt 794
    }
795
 
3430 rajveer 796
    public static class generateCouponsForPromotion_call extends org.apache.thrift.async.TAsyncMethodCall {
797
      private long promotionId;
798
      private String couponCode;
799
      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 {
800
        super(client, protocolFactory, transport, resultHandler, false);
801
        this.promotionId = promotionId;
802
        this.couponCode = couponCode;
1982 varun.gupt 803
      }
804
 
3430 rajveer 805
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
806
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("generateCouponsForPromotion", org.apache.thrift.protocol.TMessageType.CALL, 0));
807
        generateCouponsForPromotion_args args = new generateCouponsForPromotion_args();
808
        args.setPromotionId(promotionId);
809
        args.setCouponCode(couponCode);
810
        args.write(prot);
811
        prot.writeMessageEnd();
3385 varun.gupt 812
      }
813
 
3430 rajveer 814
      public void getResult() throws PromotionException, org.apache.thrift.TException {
815
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
816
          throw new IllegalStateException("Method call not finished!");
3385 varun.gupt 817
        }
3430 rajveer 818
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
819
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
820
        (new Client(prot)).recv_generateCouponsForPromotion();
3385 varun.gupt 821
      }
822
    }
823
 
3430 rajveer 824
    public void applyCoupon(String couponCode, long cartId, org.apache.thrift.async.AsyncMethodCallback<applyCoupon_call> resultHandler) throws org.apache.thrift.TException {
825
      checkReady();
826
      applyCoupon_call method_call = new applyCoupon_call(couponCode, cartId, resultHandler, this, ___protocolFactory, ___transport);
827
      this.___currentMethod = method_call;
828
      ___manager.call(method_call);
3385 varun.gupt 829
    }
830
 
3430 rajveer 831
    public static class applyCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
832
      private String couponCode;
833
      private long cartId;
834
      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 {
835
        super(client, protocolFactory, transport, resultHandler, false);
836
        this.couponCode = couponCode;
837
        this.cartId = cartId;
1982 varun.gupt 838
      }
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("applyCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
842
        applyCoupon_args args = new applyCoupon_args();
843
        args.setCouponCode(couponCode);
844
        args.setCartId(cartId);
845
        args.write(prot);
846
        prot.writeMessageEnd();
1982 varun.gupt 847
      }
848
 
3430 rajveer 849
      public Cart getResult() throws PromotionException, org.apache.thrift.TException {
850
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
851
          throw new IllegalStateException("Method call not finished!");
852
        }
853
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
854
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
855
        return (new Client(prot)).recv_applyCoupon();
1982 varun.gupt 856
      }
3430 rajveer 857
    }
1982 varun.gupt 858
 
3430 rajveer 859
    public void trackCouponUsage(String couponCode, long transactionId, long userId, org.apache.thrift.async.AsyncMethodCallback<trackCouponUsage_call> resultHandler) throws org.apache.thrift.TException {
860
      checkReady();
861
      trackCouponUsage_call method_call = new trackCouponUsage_call(couponCode, transactionId, userId, resultHandler, this, ___protocolFactory, ___transport);
862
      this.___currentMethod = method_call;
863
      ___manager.call(method_call);
864
    }
1982 varun.gupt 865
 
3430 rajveer 866
    public static class trackCouponUsage_call extends org.apache.thrift.async.TAsyncMethodCall {
867
      private String couponCode;
868
      private long transactionId;
869
      private long userId;
870
      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 {
871
        super(client, protocolFactory, transport, resultHandler, false);
872
        this.couponCode = couponCode;
873
        this.transactionId = transactionId;
874
        this.userId = userId;
1982 varun.gupt 875
      }
876
 
3430 rajveer 877
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
878
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("trackCouponUsage", org.apache.thrift.protocol.TMessageType.CALL, 0));
879
        trackCouponUsage_args args = new trackCouponUsage_args();
880
        args.setCouponCode(couponCode);
881
        args.setTransactionId(transactionId);
882
        args.setUserId(userId);
883
        args.write(prot);
884
        prot.writeMessageEnd();
1982 varun.gupt 885
      }
886
 
3430 rajveer 887
      public void getResult() throws PromotionException, org.apache.thrift.TException {
888
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
889
          throw new IllegalStateException("Method call not finished!");
890
        }
891
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
892
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
893
        (new Client(prot)).recv_trackCouponUsage();
1982 varun.gupt 894
      }
895
    }
896
 
3430 rajveer 897
    public void getCouponUsageCountByUser(String couponCode, long userId, org.apache.thrift.async.AsyncMethodCallback<getCouponUsageCountByUser_call> resultHandler) throws org.apache.thrift.TException {
898
      checkReady();
899
      getCouponUsageCountByUser_call method_call = new getCouponUsageCountByUser_call(couponCode, userId, resultHandler, this, ___protocolFactory, ___transport);
900
      this.___currentMethod = method_call;
901
      ___manager.call(method_call);
1982 varun.gupt 902
    }
903
 
3430 rajveer 904
    public static class getCouponUsageCountByUser_call extends org.apache.thrift.async.TAsyncMethodCall {
905
      private String couponCode;
906
      private long userId;
907
      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 {
908
        super(client, protocolFactory, transport, resultHandler, false);
909
        this.couponCode = couponCode;
910
        this.userId = userId;
911
      }
1982 varun.gupt 912
 
3430 rajveer 913
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
914
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getCouponUsageCountByUser", org.apache.thrift.protocol.TMessageType.CALL, 0));
915
        getCouponUsageCountByUser_args args = new getCouponUsageCountByUser_args();
916
        args.setCouponCode(couponCode);
917
        args.setUserId(userId);
918
        args.write(prot);
919
        prot.writeMessageEnd();
920
      }
1982 varun.gupt 921
 
3430 rajveer 922
      public long getResult() throws PromotionException, org.apache.thrift.TException {
923
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
924
          throw new IllegalStateException("Method call not finished!");
925
        }
926
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
927
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
928
        return (new Client(prot)).recv_getCouponUsageCountByUser();
929
      }
1982 varun.gupt 930
    }
931
 
3430 rajveer 932
    public void getActiveCoupons(org.apache.thrift.async.AsyncMethodCallback<getActiveCoupons_call> resultHandler) throws org.apache.thrift.TException {
933
      checkReady();
934
      getActiveCoupons_call method_call = new getActiveCoupons_call(resultHandler, this, ___protocolFactory, ___transport);
935
      this.___currentMethod = method_call;
936
      ___manager.call(method_call);
1982 varun.gupt 937
    }
938
 
3430 rajveer 939
    public static class getActiveCoupons_call extends org.apache.thrift.async.TAsyncMethodCall {
940
      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 {
941
        super(client, protocolFactory, transport, resultHandler, false);
1982 varun.gupt 942
      }
943
 
3430 rajveer 944
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
945
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getActiveCoupons", org.apache.thrift.protocol.TMessageType.CALL, 0));
946
        getActiveCoupons_args args = new getActiveCoupons_args();
947
        args.write(prot);
948
        prot.writeMessageEnd();
949
      }
1982 varun.gupt 950
 
3430 rajveer 951
      public List<Coupon> getResult() throws PromotionException, org.apache.thrift.TException {
952
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
953
          throw new IllegalStateException("Method call not finished!");
954
        }
955
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
956
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
957
        return (new Client(prot)).recv_getActiveCoupons();
1982 varun.gupt 958
      }
959
    }
960
 
6250 amit.gupta 961
    public void createCoupon(long promotionId, long endOn, String email, long amount, long usage, org.apache.thrift.async.AsyncMethodCallback<createCoupon_call> resultHandler) throws org.apache.thrift.TException {
962
      checkReady();
963
      createCoupon_call method_call = new createCoupon_call(promotionId, endOn, email, amount, usage, resultHandler, this, ___protocolFactory, ___transport);
964
      this.___currentMethod = method_call;
965
      ___manager.call(method_call);
966
    }
967
 
968
    public static class createCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
969
      private long promotionId;
970
      private long endOn;
971
      private String email;
972
      private long amount;
973
      private long usage;
974
      public createCoupon_call(long promotionId, long endOn, String email, long amount, long usage, org.apache.thrift.async.AsyncMethodCallback<createCoupon_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
975
        super(client, protocolFactory, transport, resultHandler, false);
976
        this.promotionId = promotionId;
977
        this.endOn = endOn;
978
        this.email = email;
979
        this.amount = amount;
980
        this.usage = usage;
981
      }
982
 
983
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
984
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
985
        createCoupon_args args = new createCoupon_args();
986
        args.setPromotionId(promotionId);
987
        args.setEndOn(endOn);
988
        args.setEmail(email);
989
        args.setAmount(amount);
990
        args.setUsage(usage);
991
        args.write(prot);
992
        prot.writeMessageEnd();
993
      }
994
 
995
      public String getResult() throws PromotionException, org.apache.thrift.TException {
996
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
997
          throw new IllegalStateException("Method call not finished!");
998
        }
999
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1000
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1001
        return (new Client(prot)).recv_createCoupon();
1002
      }
1003
    }
1004
 
3430 rajveer 1005
    public void getSuccessfulPaymentCountForCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<getSuccessfulPaymentCountForCoupon_call> resultHandler) throws org.apache.thrift.TException {
1006
      checkReady();
1007
      getSuccessfulPaymentCountForCoupon_call method_call = new getSuccessfulPaymentCountForCoupon_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
1008
      this.___currentMethod = method_call;
1009
      ___manager.call(method_call);
1982 varun.gupt 1010
    }
1011
 
3430 rajveer 1012
    public static class getSuccessfulPaymentCountForCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
1013
      private String couponCode;
1014
      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 {
1015
        super(client, protocolFactory, transport, resultHandler, false);
1016
        this.couponCode = couponCode;
1982 varun.gupt 1017
      }
1018
 
3430 rajveer 1019
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1020
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getSuccessfulPaymentCountForCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
1021
        getSuccessfulPaymentCountForCoupon_args args = new getSuccessfulPaymentCountForCoupon_args();
1022
        args.setCouponCode(couponCode);
1023
        args.write(prot);
1024
        prot.writeMessageEnd();
1025
      }
1982 varun.gupt 1026
 
3430 rajveer 1027
      public long getResult() throws PromotionException, org.apache.thrift.TException {
1028
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1029
          throw new IllegalStateException("Method call not finished!");
1030
        }
1031
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1032
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1033
        return (new Client(prot)).recv_getSuccessfulPaymentCountForCoupon();
1034
      }
1982 varun.gupt 1035
    }
1036
 
3430 rajveer 1037
    public void getRuleDocString(String ruleName, org.apache.thrift.async.AsyncMethodCallback<getRuleDocString_call> resultHandler) throws org.apache.thrift.TException {
1038
      checkReady();
1039
      getRuleDocString_call method_call = new getRuleDocString_call(ruleName, resultHandler, this, ___protocolFactory, ___transport);
1040
      this.___currentMethod = method_call;
1041
      ___manager.call(method_call);
1982 varun.gupt 1042
    }
1043
 
3430 rajveer 1044
    public static class getRuleDocString_call extends org.apache.thrift.async.TAsyncMethodCall {
1045
      private String ruleName;
1046
      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 {
1047
        super(client, protocolFactory, transport, resultHandler, false);
1048
        this.ruleName = ruleName;
1049
      }
1982 varun.gupt 1050
 
3430 rajveer 1051
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1052
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getRuleDocString", org.apache.thrift.protocol.TMessageType.CALL, 0));
1053
        getRuleDocString_args args = new getRuleDocString_args();
1054
        args.setRuleName(ruleName);
1055
        args.write(prot);
1056
        prot.writeMessageEnd();
1982 varun.gupt 1057
      }
1058
 
3430 rajveer 1059
      public String getResult() throws org.apache.thrift.TException {
1060
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1061
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 1062
        }
3430 rajveer 1063
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1064
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1065
        return (new Client(prot)).recv_getRuleDocString();
1982 varun.gupt 1066
      }
1067
    }
1068
 
4189 varun.gupt 1069
    public void getItemDiscountMap(List<Long> itemIds, org.apache.thrift.async.AsyncMethodCallback<getItemDiscountMap_call> resultHandler) throws org.apache.thrift.TException {
1070
      checkReady();
1071
      getItemDiscountMap_call method_call = new getItemDiscountMap_call(itemIds, resultHandler, this, ___protocolFactory, ___transport);
1072
      this.___currentMethod = method_call;
1073
      ___manager.call(method_call);
1074
    }
1075
 
1076
    public static class getItemDiscountMap_call extends org.apache.thrift.async.TAsyncMethodCall {
1077
      private List<Long> itemIds;
1078
      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 {
1079
        super(client, protocolFactory, transport, resultHandler, false);
1080
        this.itemIds = itemIds;
1081
      }
1082
 
1083
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1084
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getItemDiscountMap", org.apache.thrift.protocol.TMessageType.CALL, 0));
1085
        getItemDiscountMap_args args = new getItemDiscountMap_args();
1086
        args.setItemIds(itemIds);
1087
        args.write(prot);
1088
        prot.writeMessageEnd();
1089
      }
1090
 
1091
      public List<ItemCouponDiscount> getResult() throws PromotionException, org.apache.thrift.TException {
1092
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1093
          throw new IllegalStateException("Method call not finished!");
1094
        }
1095
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1096
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1097
        return (new Client(prot)).recv_getItemDiscountMap();
1098
      }
1099
    }
1100
 
4494 varun.gupt 1101
    public void getDiscountsForEntity(long entityId, org.apache.thrift.async.AsyncMethodCallback<getDiscountsForEntity_call> resultHandler) throws org.apache.thrift.TException {
1102
      checkReady();
1103
      getDiscountsForEntity_call method_call = new getDiscountsForEntity_call(entityId, resultHandler, this, ___protocolFactory, ___transport);
1104
      this.___currentMethod = method_call;
1105
      ___manager.call(method_call);
1106
    }
1107
 
1108
    public static class getDiscountsForEntity_call extends org.apache.thrift.async.TAsyncMethodCall {
1109
      private long entityId;
1110
      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 {
1111
        super(client, protocolFactory, transport, resultHandler, false);
1112
        this.entityId = entityId;
1113
      }
1114
 
1115
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1116
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getDiscountsForEntity", org.apache.thrift.protocol.TMessageType.CALL, 0));
1117
        getDiscountsForEntity_args args = new getDiscountsForEntity_args();
1118
        args.setEntityId(entityId);
1119
        args.write(prot);
1120
        prot.writeMessageEnd();
1121
      }
1122
 
1123
      public Map<String,Double> getResult() throws org.apache.thrift.TException {
1124
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1125
          throw new IllegalStateException("Method call not finished!");
1126
        }
1127
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1128
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1129
        return (new Client(prot)).recv_getDiscountsForEntity();
1130
      }
1131
    }
1132
 
5469 rajveer 1133
    public void addVoucher(Voucher voucher, org.apache.thrift.async.AsyncMethodCallback<addVoucher_call> resultHandler) throws org.apache.thrift.TException {
1134
      checkReady();
1135
      addVoucher_call method_call = new addVoucher_call(voucher, resultHandler, this, ___protocolFactory, ___transport);
1136
      this.___currentMethod = method_call;
1137
      ___manager.call(method_call);
1138
    }
1139
 
1140
    public static class addVoucher_call extends org.apache.thrift.async.TAsyncMethodCall {
1141
      private Voucher voucher;
1142
      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 {
1143
        super(client, protocolFactory, transport, resultHandler, false);
1144
        this.voucher = voucher;
1145
      }
1146
 
1147
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1148
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("addVoucher", org.apache.thrift.protocol.TMessageType.CALL, 0));
1149
        addVoucher_args args = new addVoucher_args();
1150
        args.setVoucher(voucher);
1151
        args.write(prot);
1152
        prot.writeMessageEnd();
1153
      }
1154
 
1155
      public void getResult() throws org.apache.thrift.TException {
1156
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1157
          throw new IllegalStateException("Method call not finished!");
1158
        }
1159
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1160
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1161
        (new Client(prot)).recv_addVoucher();
1162
      }
1163
    }
1164
 
1165
    public void assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount, org.apache.thrift.async.AsyncMethodCallback<assignVoucher_call> resultHandler) throws org.apache.thrift.TException {
1166
      checkReady();
1167
      assignVoucher_call method_call = new assignVoucher_call(userId, userEmail, voucherType, amount, resultHandler, this, ___protocolFactory, ___transport);
1168
      this.___currentMethod = method_call;
1169
      ___manager.call(method_call);
1170
    }
1171
 
1172
    public static class assignVoucher_call extends org.apache.thrift.async.TAsyncMethodCall {
1173
      private long userId;
1174
      private String userEmail;
1175
      private VoucherType voucherType;
1176
      private long amount;
1177
      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 {
1178
        super(client, protocolFactory, transport, resultHandler, false);
1179
        this.userId = userId;
1180
        this.userEmail = userEmail;
1181
        this.voucherType = voucherType;
1182
        this.amount = amount;
1183
      }
1184
 
1185
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1186
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("assignVoucher", org.apache.thrift.protocol.TMessageType.CALL, 0));
1187
        assignVoucher_args args = new assignVoucher_args();
1188
        args.setUserId(userId);
1189
        args.setUserEmail(userEmail);
1190
        args.setVoucherType(voucherType);
1191
        args.setAmount(amount);
1192
        args.write(prot);
1193
        prot.writeMessageEnd();
1194
      }
1195
 
1196
      public Voucher getResult() throws org.apache.thrift.TException {
1197
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1198
          throw new IllegalStateException("Method call not finished!");
1199
        }
1200
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1201
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1202
        return (new Client(prot)).recv_assignVoucher();
1203
      }
1204
    }
1205
 
1206
    public void markVoucherAsRedeemed(String voucherCode, long redeemedOn, org.apache.thrift.async.AsyncMethodCallback<markVoucherAsRedeemed_call> resultHandler) throws org.apache.thrift.TException {
1207
      checkReady();
1208
      markVoucherAsRedeemed_call method_call = new markVoucherAsRedeemed_call(voucherCode, redeemedOn, resultHandler, this, ___protocolFactory, ___transport);
1209
      this.___currentMethod = method_call;
1210
      ___manager.call(method_call);
1211
    }
1212
 
1213
    public static class markVoucherAsRedeemed_call extends org.apache.thrift.async.TAsyncMethodCall {
1214
      private String voucherCode;
1215
      private long redeemedOn;
1216
      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 {
1217
        super(client, protocolFactory, transport, resultHandler, false);
1218
        this.voucherCode = voucherCode;
1219
        this.redeemedOn = redeemedOn;
1220
      }
1221
 
1222
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1223
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("markVoucherAsRedeemed", org.apache.thrift.protocol.TMessageType.CALL, 0));
1224
        markVoucherAsRedeemed_args args = new markVoucherAsRedeemed_args();
1225
        args.setVoucherCode(voucherCode);
1226
        args.setRedeemedOn(redeemedOn);
1227
        args.write(prot);
1228
        prot.writeMessageEnd();
1229
      }
1230
 
1231
      public boolean getResult() throws org.apache.thrift.TException {
1232
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1233
          throw new IllegalStateException("Method call not finished!");
1234
        }
1235
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1236
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1237
        return (new Client(prot)).recv_markVoucherAsRedeemed();
1238
      }
1239
    }
1240
 
3430 rajveer 1241
  }
1982 varun.gupt 1242
 
3430 rajveer 1243
  public static class Processor<I extends Iface> extends in.shop2020.generic.GenericService.Processor implements org.apache.thrift.TProcessor {
1244
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
1245
    public Processor(I iface) {
1246
      super(iface, getProcessMap(new HashMap<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>>()));
1982 varun.gupt 1247
    }
1248
 
3430 rajveer 1249
    protected Processor(I iface, Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> processMap) {
1250
      super(iface, getProcessMap(processMap));
1982 varun.gupt 1251
    }
1252
 
3430 rajveer 1253
    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) {
1254
      processMap.put("createPromotion", new createPromotion());
6301 amit.gupta 1255
      processMap.put("getCoupon", new getCoupon());
1256
      processMap.put("isGiftVoucher", new isGiftVoucher());
3430 rajveer 1257
      processMap.put("getAllPromotions", new getAllPromotions());
1258
      processMap.put("getPromotionById", new getPromotionById());
1259
      processMap.put("generateCouponsForPromotion", new generateCouponsForPromotion());
1260
      processMap.put("applyCoupon", new applyCoupon());
1261
      processMap.put("trackCouponUsage", new trackCouponUsage());
1262
      processMap.put("getCouponUsageCountByUser", new getCouponUsageCountByUser());
1263
      processMap.put("getActiveCoupons", new getActiveCoupons());
6250 amit.gupta 1264
      processMap.put("createCoupon", new createCoupon());
3430 rajveer 1265
      processMap.put("getSuccessfulPaymentCountForCoupon", new getSuccessfulPaymentCountForCoupon());
1266
      processMap.put("getRuleDocString", new getRuleDocString());
4189 varun.gupt 1267
      processMap.put("getItemDiscountMap", new getItemDiscountMap());
4494 varun.gupt 1268
      processMap.put("getDiscountsForEntity", new getDiscountsForEntity());
5469 rajveer 1269
      processMap.put("addVoucher", new addVoucher());
1270
      processMap.put("assignVoucher", new assignVoucher());
1271
      processMap.put("markVoucherAsRedeemed", new markVoucherAsRedeemed());
3430 rajveer 1272
      return processMap;
1982 varun.gupt 1273
    }
1274
 
3430 rajveer 1275
    private static class createPromotion<I extends Iface> extends org.apache.thrift.ProcessFunction<I, createPromotion_args> {
1276
      public createPromotion() {
1277
        super("createPromotion");
1278
      }
1982 varun.gupt 1279
 
3430 rajveer 1280
      protected createPromotion_args getEmptyArgsInstance() {
1281
        return new createPromotion_args();
1282
      }
1982 varun.gupt 1283
 
3430 rajveer 1284
      protected createPromotion_result getResult(I iface, createPromotion_args args) throws org.apache.thrift.TException {
1285
        createPromotion_result result = new createPromotion_result();
1286
        try {
1287
          iface.createPromotion(args.name, args.ruleExecutionSrc, args.startOn, args.endOn);
1288
        } catch (PromotionException pex) {
1289
          result.pex = pex;
1982 varun.gupt 1290
        }
3430 rajveer 1291
        return result;
1982 varun.gupt 1292
      }
3430 rajveer 1293
    }
1982 varun.gupt 1294
 
6301 amit.gupta 1295
    private static class getCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getCoupon_args> {
1296
      public getCoupon() {
1297
        super("getCoupon");
1298
      }
1299
 
1300
      protected getCoupon_args getEmptyArgsInstance() {
1301
        return new getCoupon_args();
1302
      }
1303
 
1304
      protected getCoupon_result getResult(I iface, getCoupon_args args) throws org.apache.thrift.TException {
1305
        getCoupon_result result = new getCoupon_result();
1306
        try {
1307
          result.success = iface.getCoupon(args.couponCode);
1308
        } catch (PromotionException pex) {
1309
          result.pex = pex;
1310
        }
1311
        return result;
1312
      }
1313
    }
1314
 
1315
    private static class isGiftVoucher<I extends Iface> extends org.apache.thrift.ProcessFunction<I, isGiftVoucher_args> {
1316
      public isGiftVoucher() {
1317
        super("isGiftVoucher");
1318
      }
1319
 
1320
      protected isGiftVoucher_args getEmptyArgsInstance() {
1321
        return new isGiftVoucher_args();
1322
      }
1323
 
1324
      protected isGiftVoucher_result getResult(I iface, isGiftVoucher_args args) throws org.apache.thrift.TException {
1325
        isGiftVoucher_result result = new isGiftVoucher_result();
1326
        try {
1327
          result.success = iface.isGiftVoucher(args.couponCode);
1328
          result.setSuccessIsSet(true);
1329
        } catch (PromotionException pex) {
1330
          result.pex = pex;
1331
        }
1332
        return result;
1333
      }
1334
    }
1335
 
3430 rajveer 1336
    private static class getAllPromotions<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getAllPromotions_args> {
1337
      public getAllPromotions() {
1338
        super("getAllPromotions");
1982 varun.gupt 1339
      }
1340
 
3430 rajveer 1341
      protected getAllPromotions_args getEmptyArgsInstance() {
1342
        return new getAllPromotions_args();
1982 varun.gupt 1343
      }
1344
 
3430 rajveer 1345
      protected getAllPromotions_result getResult(I iface, getAllPromotions_args args) throws org.apache.thrift.TException {
1346
        getAllPromotions_result result = new getAllPromotions_result();
1347
        try {
1348
          result.success = iface.getAllPromotions();
1349
        } catch (PromotionException pex) {
1350
          result.pex = pex;
1351
        }
1352
        return result;
1982 varun.gupt 1353
      }
3430 rajveer 1354
    }
1982 varun.gupt 1355
 
3430 rajveer 1356
    private static class getPromotionById<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getPromotionById_args> {
1357
      public getPromotionById() {
1358
        super("getPromotionById");
1982 varun.gupt 1359
      }
1360
 
3430 rajveer 1361
      protected getPromotionById_args getEmptyArgsInstance() {
1362
        return new getPromotionById_args();
1982 varun.gupt 1363
      }
1364
 
3430 rajveer 1365
      protected getPromotionById_result getResult(I iface, getPromotionById_args args) throws org.apache.thrift.TException {
1366
        getPromotionById_result result = new getPromotionById_result();
1367
        try {
1368
          result.success = iface.getPromotionById(args.promotionId);
1369
        } catch (PromotionException pex) {
1370
          result.pex = pex;
1371
        }
1372
        return result;
1982 varun.gupt 1373
      }
1374
    }
1375
 
3430 rajveer 1376
    private static class generateCouponsForPromotion<I extends Iface> extends org.apache.thrift.ProcessFunction<I, generateCouponsForPromotion_args> {
1377
      public generateCouponsForPromotion() {
1378
        super("generateCouponsForPromotion");
1379
      }
1982 varun.gupt 1380
 
3430 rajveer 1381
      protected generateCouponsForPromotion_args getEmptyArgsInstance() {
1382
        return new generateCouponsForPromotion_args();
1383
      }
1982 varun.gupt 1384
 
3430 rajveer 1385
      protected generateCouponsForPromotion_result getResult(I iface, generateCouponsForPromotion_args args) throws org.apache.thrift.TException {
1386
        generateCouponsForPromotion_result result = new generateCouponsForPromotion_result();
1387
        try {
1388
          iface.generateCouponsForPromotion(args.promotionId, args.couponCode);
1389
        } catch (PromotionException pex) {
1390
          result.pex = pex;
1391
        }
1392
        return result;
1393
      }
1982 varun.gupt 1394
    }
1395
 
3430 rajveer 1396
    private static class applyCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, applyCoupon_args> {
1397
      public applyCoupon() {
1398
        super("applyCoupon");
1399
      }
1982 varun.gupt 1400
 
3430 rajveer 1401
      protected applyCoupon_args getEmptyArgsInstance() {
1402
        return new applyCoupon_args();
1403
      }
1982 varun.gupt 1404
 
3430 rajveer 1405
      protected applyCoupon_result getResult(I iface, applyCoupon_args args) throws org.apache.thrift.TException {
1406
        applyCoupon_result result = new applyCoupon_result();
1407
        try {
1408
          result.success = iface.applyCoupon(args.couponCode, args.cartId);
1409
        } catch (PromotionException pex) {
1410
          result.pex = pex;
1411
        }
1412
        return result;
1982 varun.gupt 1413
      }
1414
    }
1415
 
3430 rajveer 1416
    private static class trackCouponUsage<I extends Iface> extends org.apache.thrift.ProcessFunction<I, trackCouponUsage_args> {
1417
      public trackCouponUsage() {
1418
        super("trackCouponUsage");
1419
      }
1982 varun.gupt 1420
 
3430 rajveer 1421
      protected trackCouponUsage_args getEmptyArgsInstance() {
1422
        return new trackCouponUsage_args();
1982 varun.gupt 1423
      }
1424
 
3430 rajveer 1425
      protected trackCouponUsage_result getResult(I iface, trackCouponUsage_args args) throws org.apache.thrift.TException {
1426
        trackCouponUsage_result result = new trackCouponUsage_result();
1427
        try {
1428
          iface.trackCouponUsage(args.couponCode, args.transactionId, args.userId);
1429
        } catch (PromotionException pex) {
1430
          result.pex = pex;
1431
        }
1432
        return result;
1433
      }
1982 varun.gupt 1434
    }
1435
 
3430 rajveer 1436
    private static class getCouponUsageCountByUser<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getCouponUsageCountByUser_args> {
1437
      public getCouponUsageCountByUser() {
1438
        super("getCouponUsageCountByUser");
1982 varun.gupt 1439
      }
1440
 
3430 rajveer 1441
      protected getCouponUsageCountByUser_args getEmptyArgsInstance() {
1442
        return new getCouponUsageCountByUser_args();
1443
      }
1982 varun.gupt 1444
 
3430 rajveer 1445
      protected getCouponUsageCountByUser_result getResult(I iface, getCouponUsageCountByUser_args args) throws org.apache.thrift.TException {
1446
        getCouponUsageCountByUser_result result = new getCouponUsageCountByUser_result();
1447
        try {
1448
          result.success = iface.getCouponUsageCountByUser(args.couponCode, args.userId);
1449
          result.setSuccessIsSet(true);
1450
        } catch (PromotionException pex) {
1451
          result.pex = pex;
1452
        }
1453
        return result;
1454
      }
1982 varun.gupt 1455
    }
1456
 
3430 rajveer 1457
    private static class getActiveCoupons<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getActiveCoupons_args> {
1458
      public getActiveCoupons() {
1459
        super("getActiveCoupons");
1460
      }
1982 varun.gupt 1461
 
3430 rajveer 1462
      protected getActiveCoupons_args getEmptyArgsInstance() {
1463
        return new getActiveCoupons_args();
1464
      }
1982 varun.gupt 1465
 
3430 rajveer 1466
      protected getActiveCoupons_result getResult(I iface, getActiveCoupons_args args) throws org.apache.thrift.TException {
1467
        getActiveCoupons_result result = new getActiveCoupons_result();
1468
        try {
1469
          result.success = iface.getActiveCoupons();
1470
        } catch (PromotionException pex) {
1471
          result.pex = pex;
1472
        }
1473
        return result;
1474
      }
1982 varun.gupt 1475
    }
1476
 
6250 amit.gupta 1477
    private static class createCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, createCoupon_args> {
1478
      public createCoupon() {
1479
        super("createCoupon");
1480
      }
1481
 
1482
      protected createCoupon_args getEmptyArgsInstance() {
1483
        return new createCoupon_args();
1484
      }
1485
 
1486
      protected createCoupon_result getResult(I iface, createCoupon_args args) throws org.apache.thrift.TException {
1487
        createCoupon_result result = new createCoupon_result();
1488
        try {
1489
          result.success = iface.createCoupon(args.promotionId, args.endOn, args.email, args.amount, args.usage);
1490
        } catch (PromotionException pex) {
1491
          result.pex = pex;
1492
        }
1493
        return result;
1494
      }
1495
    }
1496
 
3430 rajveer 1497
    private static class getSuccessfulPaymentCountForCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getSuccessfulPaymentCountForCoupon_args> {
1498
      public getSuccessfulPaymentCountForCoupon() {
1499
        super("getSuccessfulPaymentCountForCoupon");
1982 varun.gupt 1500
      }
1501
 
3430 rajveer 1502
      protected getSuccessfulPaymentCountForCoupon_args getEmptyArgsInstance() {
1503
        return new getSuccessfulPaymentCountForCoupon_args();
1504
      }
1982 varun.gupt 1505
 
3430 rajveer 1506
      protected getSuccessfulPaymentCountForCoupon_result getResult(I iface, getSuccessfulPaymentCountForCoupon_args args) throws org.apache.thrift.TException {
1507
        getSuccessfulPaymentCountForCoupon_result result = new getSuccessfulPaymentCountForCoupon_result();
1508
        try {
1509
          result.success = iface.getSuccessfulPaymentCountForCoupon(args.couponCode);
1510
          result.setSuccessIsSet(true);
1511
        } catch (PromotionException pex) {
1512
          result.pex = pex;
1982 varun.gupt 1513
        }
3430 rajveer 1514
        return result;
1982 varun.gupt 1515
      }
1516
    }
1517
 
3430 rajveer 1518
    private static class getRuleDocString<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getRuleDocString_args> {
1519
      public getRuleDocString() {
1520
        super("getRuleDocString");
1521
      }
1982 varun.gupt 1522
 
3430 rajveer 1523
      protected getRuleDocString_args getEmptyArgsInstance() {
1524
        return new getRuleDocString_args();
1525
      }
1982 varun.gupt 1526
 
3430 rajveer 1527
      protected getRuleDocString_result getResult(I iface, getRuleDocString_args args) throws org.apache.thrift.TException {
1528
        getRuleDocString_result result = new getRuleDocString_result();
1529
        result.success = iface.getRuleDocString(args.ruleName);
1530
        return result;
1531
      }
1982 varun.gupt 1532
    }
1533
 
4189 varun.gupt 1534
    private static class getItemDiscountMap<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getItemDiscountMap_args> {
1535
      public getItemDiscountMap() {
1536
        super("getItemDiscountMap");
1537
      }
1538
 
1539
      protected getItemDiscountMap_args getEmptyArgsInstance() {
1540
        return new getItemDiscountMap_args();
1541
      }
1542
 
1543
      protected getItemDiscountMap_result getResult(I iface, getItemDiscountMap_args args) throws org.apache.thrift.TException {
1544
        getItemDiscountMap_result result = new getItemDiscountMap_result();
1545
        try {
1546
          result.success = iface.getItemDiscountMap(args.itemIds);
1547
        } catch (PromotionException pex) {
1548
          result.pex = pex;
1549
        }
1550
        return result;
1551
      }
1552
    }
1553
 
4494 varun.gupt 1554
    private static class getDiscountsForEntity<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getDiscountsForEntity_args> {
1555
      public getDiscountsForEntity() {
1556
        super("getDiscountsForEntity");
1557
      }
1558
 
1559
      protected getDiscountsForEntity_args getEmptyArgsInstance() {
1560
        return new getDiscountsForEntity_args();
1561
      }
1562
 
1563
      protected getDiscountsForEntity_result getResult(I iface, getDiscountsForEntity_args args) throws org.apache.thrift.TException {
1564
        getDiscountsForEntity_result result = new getDiscountsForEntity_result();
1565
        result.success = iface.getDiscountsForEntity(args.entityId);
1566
        return result;
1567
      }
1568
    }
1569
 
5469 rajveer 1570
    private static class addVoucher<I extends Iface> extends org.apache.thrift.ProcessFunction<I, addVoucher_args> {
1571
      public addVoucher() {
1572
        super("addVoucher");
1573
      }
1574
 
1575
      protected addVoucher_args getEmptyArgsInstance() {
1576
        return new addVoucher_args();
1577
      }
1578
 
1579
      protected addVoucher_result getResult(I iface, addVoucher_args args) throws org.apache.thrift.TException {
1580
        addVoucher_result result = new addVoucher_result();
1581
        iface.addVoucher(args.voucher);
1582
        return result;
1583
      }
1584
    }
1585
 
1586
    private static class assignVoucher<I extends Iface> extends org.apache.thrift.ProcessFunction<I, assignVoucher_args> {
1587
      public assignVoucher() {
1588
        super("assignVoucher");
1589
      }
1590
 
1591
      protected assignVoucher_args getEmptyArgsInstance() {
1592
        return new assignVoucher_args();
1593
      }
1594
 
1595
      protected assignVoucher_result getResult(I iface, assignVoucher_args args) throws org.apache.thrift.TException {
1596
        assignVoucher_result result = new assignVoucher_result();
1597
        result.success = iface.assignVoucher(args.userId, args.userEmail, args.voucherType, args.amount);
1598
        return result;
1599
      }
1600
    }
1601
 
1602
    private static class markVoucherAsRedeemed<I extends Iface> extends org.apache.thrift.ProcessFunction<I, markVoucherAsRedeemed_args> {
1603
      public markVoucherAsRedeemed() {
1604
        super("markVoucherAsRedeemed");
1605
      }
1606
 
1607
      protected markVoucherAsRedeemed_args getEmptyArgsInstance() {
1608
        return new markVoucherAsRedeemed_args();
1609
      }
1610
 
1611
      protected markVoucherAsRedeemed_result getResult(I iface, markVoucherAsRedeemed_args args) throws org.apache.thrift.TException {
1612
        markVoucherAsRedeemed_result result = new markVoucherAsRedeemed_result();
1613
        result.success = iface.markVoucherAsRedeemed(args.voucherCode, args.redeemedOn);
1614
        result.setSuccessIsSet(true);
1615
        return result;
1616
      }
1617
    }
1618
 
1982 varun.gupt 1619
  }
1620
 
3430 rajveer 1621
  public static class createPromotion_args implements org.apache.thrift.TBase<createPromotion_args, createPromotion_args._Fields>, java.io.Serializable, Cloneable   {
1622
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createPromotion_args");
1982 varun.gupt 1623
 
3430 rajveer 1624
    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);
1625
    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);
1626
    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);
1627
    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 1628
 
3430 rajveer 1629
    private String name; // required
1630
    private String ruleExecutionSrc; // required
1631
    private long startOn; // required
1632
    private long endOn; // required
1982 varun.gupt 1633
 
1634
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 1635
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 1636
      NAME((short)1, "name"),
1637
      RULE_EXECUTION_SRC((short)2, "ruleExecutionSrc"),
1638
      START_ON((short)3, "startOn"),
1639
      END_ON((short)4, "endOn");
1640
 
1641
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
1642
 
1643
      static {
1644
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
1645
          byName.put(field.getFieldName(), field);
1646
        }
1647
      }
1648
 
1649
      /**
1650
       * Find the _Fields constant that matches fieldId, or null if its not found.
1651
       */
1652
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 1653
        switch(fieldId) {
1654
          case 1: // NAME
1655
            return NAME;
1656
          case 2: // RULE_EXECUTION_SRC
1657
            return RULE_EXECUTION_SRC;
1658
          case 3: // START_ON
1659
            return START_ON;
1660
          case 4: // END_ON
1661
            return END_ON;
1662
          default:
1663
            return null;
1664
        }
1982 varun.gupt 1665
      }
1666
 
1667
      /**
1668
       * Find the _Fields constant that matches fieldId, throwing an exception
1669
       * if it is not found.
1670
       */
1671
      public static _Fields findByThriftIdOrThrow(int fieldId) {
1672
        _Fields fields = findByThriftId(fieldId);
1673
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
1674
        return fields;
1675
      }
1676
 
1677
      /**
1678
       * Find the _Fields constant that matches name, or null if its not found.
1679
       */
1680
      public static _Fields findByName(String name) {
1681
        return byName.get(name);
1682
      }
1683
 
1684
      private final short _thriftId;
1685
      private final String _fieldName;
1686
 
1687
      _Fields(short thriftId, String fieldName) {
1688
        _thriftId = thriftId;
1689
        _fieldName = fieldName;
1690
      }
1691
 
1692
      public short getThriftFieldId() {
1693
        return _thriftId;
1694
      }
1695
 
1696
      public String getFieldName() {
1697
        return _fieldName;
1698
      }
1699
    }
1700
 
1701
    // isset id assignments
1702
    private static final int __STARTON_ISSET_ID = 0;
1703
    private static final int __ENDON_ISSET_ID = 1;
1704
    private BitSet __isset_bit_vector = new BitSet(2);
1705
 
3430 rajveer 1706
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 1707
    static {
3430 rajveer 1708
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
1709
      tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, 
1710
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
1711
      tmpMap.put(_Fields.RULE_EXECUTION_SRC, new org.apache.thrift.meta_data.FieldMetaData("ruleExecutionSrc", org.apache.thrift.TFieldRequirementType.DEFAULT, 
1712
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
1713
      tmpMap.put(_Fields.START_ON, new org.apache.thrift.meta_data.FieldMetaData("startOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
1714
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
1715
      tmpMap.put(_Fields.END_ON, new org.apache.thrift.meta_data.FieldMetaData("endOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
1716
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
1717
      metaDataMap = Collections.unmodifiableMap(tmpMap);
1718
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createPromotion_args.class, metaDataMap);
1982 varun.gupt 1719
    }
1720
 
1721
    public createPromotion_args() {
1722
    }
1723
 
1724
    public createPromotion_args(
1725
      String name,
1726
      String ruleExecutionSrc,
1727
      long startOn,
1728
      long endOn)
1729
    {
1730
      this();
1731
      this.name = name;
1732
      this.ruleExecutionSrc = ruleExecutionSrc;
1733
      this.startOn = startOn;
1734
      setStartOnIsSet(true);
1735
      this.endOn = endOn;
1736
      setEndOnIsSet(true);
1737
    }
1738
 
1739
    /**
1740
     * Performs a deep copy on <i>other</i>.
1741
     */
1742
    public createPromotion_args(createPromotion_args other) {
1743
      __isset_bit_vector.clear();
1744
      __isset_bit_vector.or(other.__isset_bit_vector);
1745
      if (other.isSetName()) {
1746
        this.name = other.name;
1747
      }
1748
      if (other.isSetRuleExecutionSrc()) {
1749
        this.ruleExecutionSrc = other.ruleExecutionSrc;
1750
      }
1751
      this.startOn = other.startOn;
1752
      this.endOn = other.endOn;
1753
    }
1754
 
1755
    public createPromotion_args deepCopy() {
1756
      return new createPromotion_args(this);
1757
    }
1758
 
3430 rajveer 1759
    @Override
1760
    public void clear() {
1761
      this.name = null;
1762
      this.ruleExecutionSrc = null;
1763
      setStartOnIsSet(false);
1764
      this.startOn = 0;
1765
      setEndOnIsSet(false);
1766
      this.endOn = 0;
1982 varun.gupt 1767
    }
1768
 
1769
    public String getName() {
1770
      return this.name;
1771
    }
1772
 
3430 rajveer 1773
    public void setName(String name) {
1982 varun.gupt 1774
      this.name = name;
1775
    }
1776
 
1777
    public void unsetName() {
1778
      this.name = null;
1779
    }
1780
 
3430 rajveer 1781
    /** Returns true if field name is set (has been assigned a value) and false otherwise */
1982 varun.gupt 1782
    public boolean isSetName() {
1783
      return this.name != null;
1784
    }
1785
 
1786
    public void setNameIsSet(boolean value) {
1787
      if (!value) {
1788
        this.name = null;
1789
      }
1790
    }
1791
 
1792
    public String getRuleExecutionSrc() {
1793
      return this.ruleExecutionSrc;
1794
    }
1795
 
3430 rajveer 1796
    public void setRuleExecutionSrc(String ruleExecutionSrc) {
1982 varun.gupt 1797
      this.ruleExecutionSrc = ruleExecutionSrc;
1798
    }
1799
 
1800
    public void unsetRuleExecutionSrc() {
1801
      this.ruleExecutionSrc = null;
1802
    }
1803
 
3430 rajveer 1804
    /** Returns true if field ruleExecutionSrc is set (has been assigned a value) and false otherwise */
1982 varun.gupt 1805
    public boolean isSetRuleExecutionSrc() {
1806
      return this.ruleExecutionSrc != null;
1807
    }
1808
 
1809
    public void setRuleExecutionSrcIsSet(boolean value) {
1810
      if (!value) {
1811
        this.ruleExecutionSrc = null;
1812
      }
1813
    }
1814
 
1815
    public long getStartOn() {
1816
      return this.startOn;
1817
    }
1818
 
3430 rajveer 1819
    public void setStartOn(long startOn) {
1982 varun.gupt 1820
      this.startOn = startOn;
1821
      setStartOnIsSet(true);
1822
    }
1823
 
1824
    public void unsetStartOn() {
1825
      __isset_bit_vector.clear(__STARTON_ISSET_ID);
1826
    }
1827
 
3430 rajveer 1828
    /** Returns true if field startOn is set (has been assigned a value) and false otherwise */
1982 varun.gupt 1829
    public boolean isSetStartOn() {
1830
      return __isset_bit_vector.get(__STARTON_ISSET_ID);
1831
    }
1832
 
1833
    public void setStartOnIsSet(boolean value) {
1834
      __isset_bit_vector.set(__STARTON_ISSET_ID, value);
1835
    }
1836
 
1837
    public long getEndOn() {
1838
      return this.endOn;
1839
    }
1840
 
3430 rajveer 1841
    public void setEndOn(long endOn) {
1982 varun.gupt 1842
      this.endOn = endOn;
1843
      setEndOnIsSet(true);
1844
    }
1845
 
1846
    public void unsetEndOn() {
1847
      __isset_bit_vector.clear(__ENDON_ISSET_ID);
1848
    }
1849
 
3430 rajveer 1850
    /** Returns true if field endOn is set (has been assigned a value) and false otherwise */
1982 varun.gupt 1851
    public boolean isSetEndOn() {
1852
      return __isset_bit_vector.get(__ENDON_ISSET_ID);
1853
    }
1854
 
1855
    public void setEndOnIsSet(boolean value) {
1856
      __isset_bit_vector.set(__ENDON_ISSET_ID, value);
1857
    }
1858
 
1859
    public void setFieldValue(_Fields field, Object value) {
1860
      switch (field) {
1861
      case NAME:
1862
        if (value == null) {
1863
          unsetName();
1864
        } else {
1865
          setName((String)value);
1866
        }
1867
        break;
1868
 
1869
      case RULE_EXECUTION_SRC:
1870
        if (value == null) {
1871
          unsetRuleExecutionSrc();
1872
        } else {
1873
          setRuleExecutionSrc((String)value);
1874
        }
1875
        break;
1876
 
1877
      case START_ON:
1878
        if (value == null) {
1879
          unsetStartOn();
1880
        } else {
1881
          setStartOn((Long)value);
1882
        }
1883
        break;
1884
 
1885
      case END_ON:
1886
        if (value == null) {
1887
          unsetEndOn();
1888
        } else {
1889
          setEndOn((Long)value);
1890
        }
1891
        break;
1892
 
1893
      }
1894
    }
1895
 
1896
    public Object getFieldValue(_Fields field) {
1897
      switch (field) {
1898
      case NAME:
1899
        return getName();
1900
 
1901
      case RULE_EXECUTION_SRC:
1902
        return getRuleExecutionSrc();
1903
 
1904
      case START_ON:
3430 rajveer 1905
        return Long.valueOf(getStartOn());
1982 varun.gupt 1906
 
1907
      case END_ON:
3430 rajveer 1908
        return Long.valueOf(getEndOn());
1982 varun.gupt 1909
 
1910
      }
1911
      throw new IllegalStateException();
1912
    }
1913
 
3430 rajveer 1914
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
1915
    public boolean isSet(_Fields field) {
1916
      if (field == null) {
1917
        throw new IllegalArgumentException();
1918
      }
1982 varun.gupt 1919
 
1920
      switch (field) {
1921
      case NAME:
1922
        return isSetName();
1923
      case RULE_EXECUTION_SRC:
1924
        return isSetRuleExecutionSrc();
1925
      case START_ON:
1926
        return isSetStartOn();
1927
      case END_ON:
1928
        return isSetEndOn();
1929
      }
1930
      throw new IllegalStateException();
1931
    }
1932
 
1933
    @Override
1934
    public boolean equals(Object that) {
1935
      if (that == null)
1936
        return false;
1937
      if (that instanceof createPromotion_args)
1938
        return this.equals((createPromotion_args)that);
1939
      return false;
1940
    }
1941
 
1942
    public boolean equals(createPromotion_args that) {
1943
      if (that == null)
1944
        return false;
1945
 
1946
      boolean this_present_name = true && this.isSetName();
1947
      boolean that_present_name = true && that.isSetName();
1948
      if (this_present_name || that_present_name) {
1949
        if (!(this_present_name && that_present_name))
1950
          return false;
1951
        if (!this.name.equals(that.name))
1952
          return false;
1953
      }
1954
 
1955
      boolean this_present_ruleExecutionSrc = true && this.isSetRuleExecutionSrc();
1956
      boolean that_present_ruleExecutionSrc = true && that.isSetRuleExecutionSrc();
1957
      if (this_present_ruleExecutionSrc || that_present_ruleExecutionSrc) {
1958
        if (!(this_present_ruleExecutionSrc && that_present_ruleExecutionSrc))
1959
          return false;
1960
        if (!this.ruleExecutionSrc.equals(that.ruleExecutionSrc))
1961
          return false;
1962
      }
1963
 
1964
      boolean this_present_startOn = true;
1965
      boolean that_present_startOn = true;
1966
      if (this_present_startOn || that_present_startOn) {
1967
        if (!(this_present_startOn && that_present_startOn))
1968
          return false;
1969
        if (this.startOn != that.startOn)
1970
          return false;
1971
      }
1972
 
1973
      boolean this_present_endOn = true;
1974
      boolean that_present_endOn = true;
1975
      if (this_present_endOn || that_present_endOn) {
1976
        if (!(this_present_endOn && that_present_endOn))
1977
          return false;
1978
        if (this.endOn != that.endOn)
1979
          return false;
1980
      }
1981
 
1982
      return true;
1983
    }
1984
 
1985
    @Override
1986
    public int hashCode() {
1987
      return 0;
1988
    }
1989
 
1990
    public int compareTo(createPromotion_args other) {
1991
      if (!getClass().equals(other.getClass())) {
1992
        return getClass().getName().compareTo(other.getClass().getName());
1993
      }
1994
 
1995
      int lastComparison = 0;
1996
      createPromotion_args typedOther = (createPromotion_args)other;
1997
 
3430 rajveer 1998
      lastComparison = Boolean.valueOf(isSetName()).compareTo(typedOther.isSetName());
1982 varun.gupt 1999
      if (lastComparison != 0) {
2000
        return lastComparison;
2001
      }
3430 rajveer 2002
      if (isSetName()) {
2003
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, typedOther.name);
2004
        if (lastComparison != 0) {
2005
          return lastComparison;
2006
        }
1982 varun.gupt 2007
      }
3430 rajveer 2008
      lastComparison = Boolean.valueOf(isSetRuleExecutionSrc()).compareTo(typedOther.isSetRuleExecutionSrc());
1982 varun.gupt 2009
      if (lastComparison != 0) {
2010
        return lastComparison;
2011
      }
3430 rajveer 2012
      if (isSetRuleExecutionSrc()) {
2013
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ruleExecutionSrc, typedOther.ruleExecutionSrc);
2014
        if (lastComparison != 0) {
2015
          return lastComparison;
2016
        }
1982 varun.gupt 2017
      }
3430 rajveer 2018
      lastComparison = Boolean.valueOf(isSetStartOn()).compareTo(typedOther.isSetStartOn());
1982 varun.gupt 2019
      if (lastComparison != 0) {
2020
        return lastComparison;
2021
      }
3430 rajveer 2022
      if (isSetStartOn()) {
2023
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startOn, typedOther.startOn);
2024
        if (lastComparison != 0) {
2025
          return lastComparison;
2026
        }
1982 varun.gupt 2027
      }
3430 rajveer 2028
      lastComparison = Boolean.valueOf(isSetEndOn()).compareTo(typedOther.isSetEndOn());
1982 varun.gupt 2029
      if (lastComparison != 0) {
2030
        return lastComparison;
2031
      }
3430 rajveer 2032
      if (isSetEndOn()) {
2033
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endOn, typedOther.endOn);
2034
        if (lastComparison != 0) {
2035
          return lastComparison;
2036
        }
1982 varun.gupt 2037
      }
2038
      return 0;
2039
    }
2040
 
3430 rajveer 2041
    public _Fields fieldForId(int fieldId) {
2042
      return _Fields.findByThriftId(fieldId);
2043
    }
2044
 
2045
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
2046
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 2047
      iprot.readStructBegin();
2048
      while (true)
2049
      {
2050
        field = iprot.readFieldBegin();
3430 rajveer 2051
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 2052
          break;
2053
        }
3430 rajveer 2054
        switch (field.id) {
2055
          case 1: // NAME
2056
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
2057
              this.name = iprot.readString();
2058
            } else { 
2059
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2060
            }
2061
            break;
2062
          case 2: // RULE_EXECUTION_SRC
2063
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
2064
              this.ruleExecutionSrc = iprot.readString();
2065
            } else { 
2066
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2067
            }
2068
            break;
2069
          case 3: // START_ON
2070
            if (field.type == org.apache.thrift.protocol.TType.I64) {
2071
              this.startOn = iprot.readI64();
2072
              setStartOnIsSet(true);
2073
            } else { 
2074
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2075
            }
2076
            break;
2077
          case 4: // END_ON
2078
            if (field.type == org.apache.thrift.protocol.TType.I64) {
2079
              this.endOn = iprot.readI64();
2080
              setEndOnIsSet(true);
2081
            } else { 
2082
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2083
            }
2084
            break;
2085
          default:
2086
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 2087
        }
3430 rajveer 2088
        iprot.readFieldEnd();
1982 varun.gupt 2089
      }
2090
      iprot.readStructEnd();
2091
      validate();
2092
    }
2093
 
3430 rajveer 2094
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 2095
      validate();
2096
 
2097
      oprot.writeStructBegin(STRUCT_DESC);
2098
      if (this.name != null) {
2099
        oprot.writeFieldBegin(NAME_FIELD_DESC);
2100
        oprot.writeString(this.name);
2101
        oprot.writeFieldEnd();
2102
      }
2103
      if (this.ruleExecutionSrc != null) {
2104
        oprot.writeFieldBegin(RULE_EXECUTION_SRC_FIELD_DESC);
2105
        oprot.writeString(this.ruleExecutionSrc);
2106
        oprot.writeFieldEnd();
2107
      }
2108
      oprot.writeFieldBegin(START_ON_FIELD_DESC);
2109
      oprot.writeI64(this.startOn);
2110
      oprot.writeFieldEnd();
2111
      oprot.writeFieldBegin(END_ON_FIELD_DESC);
2112
      oprot.writeI64(this.endOn);
2113
      oprot.writeFieldEnd();
2114
      oprot.writeFieldStop();
2115
      oprot.writeStructEnd();
2116
    }
2117
 
2118
    @Override
2119
    public String toString() {
2120
      StringBuilder sb = new StringBuilder("createPromotion_args(");
2121
      boolean first = true;
2122
 
2123
      sb.append("name:");
2124
      if (this.name == null) {
2125
        sb.append("null");
2126
      } else {
2127
        sb.append(this.name);
2128
      }
2129
      first = false;
2130
      if (!first) sb.append(", ");
2131
      sb.append("ruleExecutionSrc:");
2132
      if (this.ruleExecutionSrc == null) {
2133
        sb.append("null");
2134
      } else {
2135
        sb.append(this.ruleExecutionSrc);
2136
      }
2137
      first = false;
2138
      if (!first) sb.append(", ");
2139
      sb.append("startOn:");
2140
      sb.append(this.startOn);
2141
      first = false;
2142
      if (!first) sb.append(", ");
2143
      sb.append("endOn:");
2144
      sb.append(this.endOn);
2145
      first = false;
2146
      sb.append(")");
2147
      return sb.toString();
2148
    }
2149
 
3430 rajveer 2150
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 2151
      // check for required fields
2152
    }
2153
 
3430 rajveer 2154
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
2155
      try {
2156
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
2157
      } catch (org.apache.thrift.TException te) {
2158
        throw new java.io.IOException(te);
2159
      }
2160
    }
2161
 
2162
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
2163
      try {
2164
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
2165
        __isset_bit_vector = new BitSet(1);
2166
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
2167
      } catch (org.apache.thrift.TException te) {
2168
        throw new java.io.IOException(te);
2169
      }
2170
    }
2171
 
1982 varun.gupt 2172
  }
2173
 
3430 rajveer 2174
  public static class createPromotion_result implements org.apache.thrift.TBase<createPromotion_result, createPromotion_result._Fields>, java.io.Serializable, Cloneable   {
2175
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createPromotion_result");
1982 varun.gupt 2176
 
3430 rajveer 2177
    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 2178
 
3430 rajveer 2179
    private PromotionException pex; // required
1982 varun.gupt 2180
 
2181
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 2182
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 2183
      PEX((short)1, "pex");
2184
 
2185
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2186
 
2187
      static {
2188
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2189
          byName.put(field.getFieldName(), field);
2190
        }
2191
      }
2192
 
2193
      /**
2194
       * Find the _Fields constant that matches fieldId, or null if its not found.
2195
       */
2196
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 2197
        switch(fieldId) {
2198
          case 1: // PEX
2199
            return PEX;
2200
          default:
2201
            return null;
2202
        }
1982 varun.gupt 2203
      }
2204
 
2205
      /**
2206
       * Find the _Fields constant that matches fieldId, throwing an exception
2207
       * if it is not found.
2208
       */
2209
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2210
        _Fields fields = findByThriftId(fieldId);
2211
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2212
        return fields;
2213
      }
2214
 
2215
      /**
2216
       * Find the _Fields constant that matches name, or null if its not found.
2217
       */
2218
      public static _Fields findByName(String name) {
2219
        return byName.get(name);
2220
      }
2221
 
2222
      private final short _thriftId;
2223
      private final String _fieldName;
2224
 
2225
      _Fields(short thriftId, String fieldName) {
2226
        _thriftId = thriftId;
2227
        _fieldName = fieldName;
2228
      }
2229
 
2230
      public short getThriftFieldId() {
2231
        return _thriftId;
2232
      }
2233
 
2234
      public String getFieldName() {
2235
        return _fieldName;
2236
      }
2237
    }
2238
 
2239
    // isset id assignments
2240
 
3430 rajveer 2241
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 2242
    static {
3430 rajveer 2243
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
2244
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2245
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
2246
      metaDataMap = Collections.unmodifiableMap(tmpMap);
2247
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createPromotion_result.class, metaDataMap);
1982 varun.gupt 2248
    }
2249
 
2250
    public createPromotion_result() {
2251
    }
2252
 
2253
    public createPromotion_result(
2254
      PromotionException pex)
2255
    {
2256
      this();
2257
      this.pex = pex;
2258
    }
2259
 
2260
    /**
2261
     * Performs a deep copy on <i>other</i>.
2262
     */
2263
    public createPromotion_result(createPromotion_result other) {
2264
      if (other.isSetPex()) {
2265
        this.pex = new PromotionException(other.pex);
2266
      }
2267
    }
2268
 
2269
    public createPromotion_result deepCopy() {
2270
      return new createPromotion_result(this);
2271
    }
2272
 
3430 rajveer 2273
    @Override
2274
    public void clear() {
2275
      this.pex = null;
1982 varun.gupt 2276
    }
2277
 
2278
    public PromotionException getPex() {
2279
      return this.pex;
2280
    }
2281
 
3430 rajveer 2282
    public void setPex(PromotionException pex) {
1982 varun.gupt 2283
      this.pex = pex;
2284
    }
2285
 
2286
    public void unsetPex() {
2287
      this.pex = null;
2288
    }
2289
 
3430 rajveer 2290
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2291
    public boolean isSetPex() {
2292
      return this.pex != null;
2293
    }
2294
 
2295
    public void setPexIsSet(boolean value) {
2296
      if (!value) {
2297
        this.pex = null;
2298
      }
2299
    }
2300
 
2301
    public void setFieldValue(_Fields field, Object value) {
2302
      switch (field) {
2303
      case PEX:
2304
        if (value == null) {
2305
          unsetPex();
2306
        } else {
2307
          setPex((PromotionException)value);
2308
        }
2309
        break;
2310
 
2311
      }
2312
    }
2313
 
2314
    public Object getFieldValue(_Fields field) {
2315
      switch (field) {
2316
      case PEX:
2317
        return getPex();
2318
 
2319
      }
2320
      throw new IllegalStateException();
2321
    }
2322
 
3430 rajveer 2323
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
2324
    public boolean isSet(_Fields field) {
2325
      if (field == null) {
2326
        throw new IllegalArgumentException();
2327
      }
1982 varun.gupt 2328
 
2329
      switch (field) {
2330
      case PEX:
2331
        return isSetPex();
2332
      }
2333
      throw new IllegalStateException();
2334
    }
2335
 
2336
    @Override
2337
    public boolean equals(Object that) {
2338
      if (that == null)
2339
        return false;
2340
      if (that instanceof createPromotion_result)
2341
        return this.equals((createPromotion_result)that);
2342
      return false;
2343
    }
2344
 
2345
    public boolean equals(createPromotion_result that) {
2346
      if (that == null)
2347
        return false;
2348
 
2349
      boolean this_present_pex = true && this.isSetPex();
2350
      boolean that_present_pex = true && that.isSetPex();
2351
      if (this_present_pex || that_present_pex) {
2352
        if (!(this_present_pex && that_present_pex))
2353
          return false;
2354
        if (!this.pex.equals(that.pex))
2355
          return false;
2356
      }
2357
 
2358
      return true;
2359
    }
2360
 
2361
    @Override
2362
    public int hashCode() {
2363
      return 0;
2364
    }
2365
 
2366
    public int compareTo(createPromotion_result other) {
2367
      if (!getClass().equals(other.getClass())) {
2368
        return getClass().getName().compareTo(other.getClass().getName());
2369
      }
2370
 
2371
      int lastComparison = 0;
2372
      createPromotion_result typedOther = (createPromotion_result)other;
2373
 
3430 rajveer 2374
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 2375
      if (lastComparison != 0) {
2376
        return lastComparison;
2377
      }
3430 rajveer 2378
      if (isSetPex()) {
2379
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
2380
        if (lastComparison != 0) {
2381
          return lastComparison;
2382
        }
1982 varun.gupt 2383
      }
2384
      return 0;
2385
    }
2386
 
3430 rajveer 2387
    public _Fields fieldForId(int fieldId) {
2388
      return _Fields.findByThriftId(fieldId);
2389
    }
2390
 
2391
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
2392
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 2393
      iprot.readStructBegin();
2394
      while (true)
2395
      {
2396
        field = iprot.readFieldBegin();
3430 rajveer 2397
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 2398
          break;
2399
        }
3430 rajveer 2400
        switch (field.id) {
2401
          case 1: // PEX
2402
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
2403
              this.pex = new PromotionException();
2404
              this.pex.read(iprot);
2405
            } else { 
2406
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2407
            }
2408
            break;
2409
          default:
2410
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 2411
        }
3430 rajveer 2412
        iprot.readFieldEnd();
1982 varun.gupt 2413
      }
2414
      iprot.readStructEnd();
2415
      validate();
2416
    }
2417
 
3430 rajveer 2418
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 2419
      oprot.writeStructBegin(STRUCT_DESC);
2420
 
2421
      if (this.isSetPex()) {
2422
        oprot.writeFieldBegin(PEX_FIELD_DESC);
2423
        this.pex.write(oprot);
2424
        oprot.writeFieldEnd();
2425
      }
2426
      oprot.writeFieldStop();
2427
      oprot.writeStructEnd();
2428
    }
2429
 
2430
    @Override
2431
    public String toString() {
2432
      StringBuilder sb = new StringBuilder("createPromotion_result(");
2433
      boolean first = true;
2434
 
2435
      sb.append("pex:");
2436
      if (this.pex == null) {
2437
        sb.append("null");
2438
      } else {
2439
        sb.append(this.pex);
2440
      }
2441
      first = false;
2442
      sb.append(")");
2443
      return sb.toString();
2444
    }
2445
 
3430 rajveer 2446
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 2447
      // check for required fields
2448
    }
2449
 
3430 rajveer 2450
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
2451
      try {
2452
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
2453
      } catch (org.apache.thrift.TException te) {
2454
        throw new java.io.IOException(te);
2455
      }
2456
    }
2457
 
2458
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
2459
      try {
2460
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
2461
      } catch (org.apache.thrift.TException te) {
2462
        throw new java.io.IOException(te);
2463
      }
2464
    }
2465
 
1982 varun.gupt 2466
  }
2467
 
6301 amit.gupta 2468
  public static class getCoupon_args implements org.apache.thrift.TBase<getCoupon_args, getCoupon_args._Fields>, java.io.Serializable, Cloneable   {
2469
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCoupon_args");
2470
 
2471
    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);
2472
 
2473
    private String couponCode; // required
2474
 
2475
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
2476
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
2477
      COUPON_CODE((short)1, "couponCode");
2478
 
2479
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2480
 
2481
      static {
2482
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2483
          byName.put(field.getFieldName(), field);
2484
        }
2485
      }
2486
 
2487
      /**
2488
       * Find the _Fields constant that matches fieldId, or null if its not found.
2489
       */
2490
      public static _Fields findByThriftId(int fieldId) {
2491
        switch(fieldId) {
2492
          case 1: // COUPON_CODE
2493
            return COUPON_CODE;
2494
          default:
2495
            return null;
2496
        }
2497
      }
2498
 
2499
      /**
2500
       * Find the _Fields constant that matches fieldId, throwing an exception
2501
       * if it is not found.
2502
       */
2503
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2504
        _Fields fields = findByThriftId(fieldId);
2505
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2506
        return fields;
2507
      }
2508
 
2509
      /**
2510
       * Find the _Fields constant that matches name, or null if its not found.
2511
       */
2512
      public static _Fields findByName(String name) {
2513
        return byName.get(name);
2514
      }
2515
 
2516
      private final short _thriftId;
2517
      private final String _fieldName;
2518
 
2519
      _Fields(short thriftId, String fieldName) {
2520
        _thriftId = thriftId;
2521
        _fieldName = fieldName;
2522
      }
2523
 
2524
      public short getThriftFieldId() {
2525
        return _thriftId;
2526
      }
2527
 
2528
      public String getFieldName() {
2529
        return _fieldName;
2530
      }
2531
    }
2532
 
2533
    // isset id assignments
2534
 
2535
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
2536
    static {
2537
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
2538
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2539
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
2540
      metaDataMap = Collections.unmodifiableMap(tmpMap);
2541
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCoupon_args.class, metaDataMap);
2542
    }
2543
 
2544
    public getCoupon_args() {
2545
    }
2546
 
2547
    public getCoupon_args(
2548
      String couponCode)
2549
    {
2550
      this();
2551
      this.couponCode = couponCode;
2552
    }
2553
 
2554
    /**
2555
     * Performs a deep copy on <i>other</i>.
2556
     */
2557
    public getCoupon_args(getCoupon_args other) {
2558
      if (other.isSetCouponCode()) {
2559
        this.couponCode = other.couponCode;
2560
      }
2561
    }
2562
 
2563
    public getCoupon_args deepCopy() {
2564
      return new getCoupon_args(this);
2565
    }
2566
 
2567
    @Override
2568
    public void clear() {
2569
      this.couponCode = null;
2570
    }
2571
 
2572
    public String getCouponCode() {
2573
      return this.couponCode;
2574
    }
2575
 
2576
    public void setCouponCode(String couponCode) {
2577
      this.couponCode = couponCode;
2578
    }
2579
 
2580
    public void unsetCouponCode() {
2581
      this.couponCode = null;
2582
    }
2583
 
2584
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
2585
    public boolean isSetCouponCode() {
2586
      return this.couponCode != null;
2587
    }
2588
 
2589
    public void setCouponCodeIsSet(boolean value) {
2590
      if (!value) {
2591
        this.couponCode = null;
2592
      }
2593
    }
2594
 
2595
    public void setFieldValue(_Fields field, Object value) {
2596
      switch (field) {
2597
      case COUPON_CODE:
2598
        if (value == null) {
2599
          unsetCouponCode();
2600
        } else {
2601
          setCouponCode((String)value);
2602
        }
2603
        break;
2604
 
2605
      }
2606
    }
2607
 
2608
    public Object getFieldValue(_Fields field) {
2609
      switch (field) {
2610
      case COUPON_CODE:
2611
        return getCouponCode();
2612
 
2613
      }
2614
      throw new IllegalStateException();
2615
    }
2616
 
2617
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
2618
    public boolean isSet(_Fields field) {
2619
      if (field == null) {
2620
        throw new IllegalArgumentException();
2621
      }
2622
 
2623
      switch (field) {
2624
      case COUPON_CODE:
2625
        return isSetCouponCode();
2626
      }
2627
      throw new IllegalStateException();
2628
    }
2629
 
2630
    @Override
2631
    public boolean equals(Object that) {
2632
      if (that == null)
2633
        return false;
2634
      if (that instanceof getCoupon_args)
2635
        return this.equals((getCoupon_args)that);
2636
      return false;
2637
    }
2638
 
2639
    public boolean equals(getCoupon_args that) {
2640
      if (that == null)
2641
        return false;
2642
 
2643
      boolean this_present_couponCode = true && this.isSetCouponCode();
2644
      boolean that_present_couponCode = true && that.isSetCouponCode();
2645
      if (this_present_couponCode || that_present_couponCode) {
2646
        if (!(this_present_couponCode && that_present_couponCode))
2647
          return false;
2648
        if (!this.couponCode.equals(that.couponCode))
2649
          return false;
2650
      }
2651
 
2652
      return true;
2653
    }
2654
 
2655
    @Override
2656
    public int hashCode() {
2657
      return 0;
2658
    }
2659
 
2660
    public int compareTo(getCoupon_args other) {
2661
      if (!getClass().equals(other.getClass())) {
2662
        return getClass().getName().compareTo(other.getClass().getName());
2663
      }
2664
 
2665
      int lastComparison = 0;
2666
      getCoupon_args typedOther = (getCoupon_args)other;
2667
 
2668
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
2669
      if (lastComparison != 0) {
2670
        return lastComparison;
2671
      }
2672
      if (isSetCouponCode()) {
2673
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
2674
        if (lastComparison != 0) {
2675
          return lastComparison;
2676
        }
2677
      }
2678
      return 0;
2679
    }
2680
 
2681
    public _Fields fieldForId(int fieldId) {
2682
      return _Fields.findByThriftId(fieldId);
2683
    }
2684
 
2685
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
2686
      org.apache.thrift.protocol.TField field;
2687
      iprot.readStructBegin();
2688
      while (true)
2689
      {
2690
        field = iprot.readFieldBegin();
2691
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
2692
          break;
2693
        }
2694
        switch (field.id) {
2695
          case 1: // COUPON_CODE
2696
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
2697
              this.couponCode = iprot.readString();
2698
            } else { 
2699
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2700
            }
2701
            break;
2702
          default:
2703
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2704
        }
2705
        iprot.readFieldEnd();
2706
      }
2707
      iprot.readStructEnd();
2708
      validate();
2709
    }
2710
 
2711
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
2712
      validate();
2713
 
2714
      oprot.writeStructBegin(STRUCT_DESC);
2715
      if (this.couponCode != null) {
2716
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
2717
        oprot.writeString(this.couponCode);
2718
        oprot.writeFieldEnd();
2719
      }
2720
      oprot.writeFieldStop();
2721
      oprot.writeStructEnd();
2722
    }
2723
 
2724
    @Override
2725
    public String toString() {
2726
      StringBuilder sb = new StringBuilder("getCoupon_args(");
2727
      boolean first = true;
2728
 
2729
      sb.append("couponCode:");
2730
      if (this.couponCode == null) {
2731
        sb.append("null");
2732
      } else {
2733
        sb.append(this.couponCode);
2734
      }
2735
      first = false;
2736
      sb.append(")");
2737
      return sb.toString();
2738
    }
2739
 
2740
    public void validate() throws org.apache.thrift.TException {
2741
      // check for required fields
2742
    }
2743
 
2744
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
2745
      try {
2746
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
2747
      } catch (org.apache.thrift.TException te) {
2748
        throw new java.io.IOException(te);
2749
      }
2750
    }
2751
 
2752
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
2753
      try {
2754
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
2755
      } catch (org.apache.thrift.TException te) {
2756
        throw new java.io.IOException(te);
2757
      }
2758
    }
2759
 
2760
  }
2761
 
2762
  public static class getCoupon_result implements org.apache.thrift.TBase<getCoupon_result, getCoupon_result._Fields>, java.io.Serializable, Cloneable   {
2763
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCoupon_result");
2764
 
2765
    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);
2766
    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);
2767
 
2768
    private Coupon success; // required
2769
    private PromotionException pex; // required
2770
 
2771
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
2772
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
2773
      SUCCESS((short)0, "success"),
2774
      PEX((short)1, "pex");
2775
 
2776
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2777
 
2778
      static {
2779
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2780
          byName.put(field.getFieldName(), field);
2781
        }
2782
      }
2783
 
2784
      /**
2785
       * Find the _Fields constant that matches fieldId, or null if its not found.
2786
       */
2787
      public static _Fields findByThriftId(int fieldId) {
2788
        switch(fieldId) {
2789
          case 0: // SUCCESS
2790
            return SUCCESS;
2791
          case 1: // PEX
2792
            return PEX;
2793
          default:
2794
            return null;
2795
        }
2796
      }
2797
 
2798
      /**
2799
       * Find the _Fields constant that matches fieldId, throwing an exception
2800
       * if it is not found.
2801
       */
2802
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2803
        _Fields fields = findByThriftId(fieldId);
2804
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2805
        return fields;
2806
      }
2807
 
2808
      /**
2809
       * Find the _Fields constant that matches name, or null if its not found.
2810
       */
2811
      public static _Fields findByName(String name) {
2812
        return byName.get(name);
2813
      }
2814
 
2815
      private final short _thriftId;
2816
      private final String _fieldName;
2817
 
2818
      _Fields(short thriftId, String fieldName) {
2819
        _thriftId = thriftId;
2820
        _fieldName = fieldName;
2821
      }
2822
 
2823
      public short getThriftFieldId() {
2824
        return _thriftId;
2825
      }
2826
 
2827
      public String getFieldName() {
2828
        return _fieldName;
2829
      }
2830
    }
2831
 
2832
    // isset id assignments
2833
 
2834
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
2835
    static {
2836
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
2837
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2838
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Coupon.class)));
2839
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2840
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
2841
      metaDataMap = Collections.unmodifiableMap(tmpMap);
2842
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCoupon_result.class, metaDataMap);
2843
    }
2844
 
2845
    public getCoupon_result() {
2846
    }
2847
 
2848
    public getCoupon_result(
2849
      Coupon success,
2850
      PromotionException pex)
2851
    {
2852
      this();
2853
      this.success = success;
2854
      this.pex = pex;
2855
    }
2856
 
2857
    /**
2858
     * Performs a deep copy on <i>other</i>.
2859
     */
2860
    public getCoupon_result(getCoupon_result other) {
2861
      if (other.isSetSuccess()) {
2862
        this.success = new Coupon(other.success);
2863
      }
2864
      if (other.isSetPex()) {
2865
        this.pex = new PromotionException(other.pex);
2866
      }
2867
    }
2868
 
2869
    public getCoupon_result deepCopy() {
2870
      return new getCoupon_result(this);
2871
    }
2872
 
2873
    @Override
2874
    public void clear() {
2875
      this.success = null;
2876
      this.pex = null;
2877
    }
2878
 
2879
    public Coupon getSuccess() {
2880
      return this.success;
2881
    }
2882
 
2883
    public void setSuccess(Coupon success) {
2884
      this.success = success;
2885
    }
2886
 
2887
    public void unsetSuccess() {
2888
      this.success = null;
2889
    }
2890
 
2891
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
2892
    public boolean isSetSuccess() {
2893
      return this.success != null;
2894
    }
2895
 
2896
    public void setSuccessIsSet(boolean value) {
2897
      if (!value) {
2898
        this.success = null;
2899
      }
2900
    }
2901
 
2902
    public PromotionException getPex() {
2903
      return this.pex;
2904
    }
2905
 
2906
    public void setPex(PromotionException pex) {
2907
      this.pex = pex;
2908
    }
2909
 
2910
    public void unsetPex() {
2911
      this.pex = null;
2912
    }
2913
 
2914
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
2915
    public boolean isSetPex() {
2916
      return this.pex != null;
2917
    }
2918
 
2919
    public void setPexIsSet(boolean value) {
2920
      if (!value) {
2921
        this.pex = null;
2922
      }
2923
    }
2924
 
2925
    public void setFieldValue(_Fields field, Object value) {
2926
      switch (field) {
2927
      case SUCCESS:
2928
        if (value == null) {
2929
          unsetSuccess();
2930
        } else {
2931
          setSuccess((Coupon)value);
2932
        }
2933
        break;
2934
 
2935
      case PEX:
2936
        if (value == null) {
2937
          unsetPex();
2938
        } else {
2939
          setPex((PromotionException)value);
2940
        }
2941
        break;
2942
 
2943
      }
2944
    }
2945
 
2946
    public Object getFieldValue(_Fields field) {
2947
      switch (field) {
2948
      case SUCCESS:
2949
        return getSuccess();
2950
 
2951
      case PEX:
2952
        return getPex();
2953
 
2954
      }
2955
      throw new IllegalStateException();
2956
    }
2957
 
2958
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
2959
    public boolean isSet(_Fields field) {
2960
      if (field == null) {
2961
        throw new IllegalArgumentException();
2962
      }
2963
 
2964
      switch (field) {
2965
      case SUCCESS:
2966
        return isSetSuccess();
2967
      case PEX:
2968
        return isSetPex();
2969
      }
2970
      throw new IllegalStateException();
2971
    }
2972
 
2973
    @Override
2974
    public boolean equals(Object that) {
2975
      if (that == null)
2976
        return false;
2977
      if (that instanceof getCoupon_result)
2978
        return this.equals((getCoupon_result)that);
2979
      return false;
2980
    }
2981
 
2982
    public boolean equals(getCoupon_result that) {
2983
      if (that == null)
2984
        return false;
2985
 
2986
      boolean this_present_success = true && this.isSetSuccess();
2987
      boolean that_present_success = true && that.isSetSuccess();
2988
      if (this_present_success || that_present_success) {
2989
        if (!(this_present_success && that_present_success))
2990
          return false;
2991
        if (!this.success.equals(that.success))
2992
          return false;
2993
      }
2994
 
2995
      boolean this_present_pex = true && this.isSetPex();
2996
      boolean that_present_pex = true && that.isSetPex();
2997
      if (this_present_pex || that_present_pex) {
2998
        if (!(this_present_pex && that_present_pex))
2999
          return false;
3000
        if (!this.pex.equals(that.pex))
3001
          return false;
3002
      }
3003
 
3004
      return true;
3005
    }
3006
 
3007
    @Override
3008
    public int hashCode() {
3009
      return 0;
3010
    }
3011
 
3012
    public int compareTo(getCoupon_result other) {
3013
      if (!getClass().equals(other.getClass())) {
3014
        return getClass().getName().compareTo(other.getClass().getName());
3015
      }
3016
 
3017
      int lastComparison = 0;
3018
      getCoupon_result typedOther = (getCoupon_result)other;
3019
 
3020
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3021
      if (lastComparison != 0) {
3022
        return lastComparison;
3023
      }
3024
      if (isSetSuccess()) {
3025
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
3026
        if (lastComparison != 0) {
3027
          return lastComparison;
3028
        }
3029
      }
3030
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
3031
      if (lastComparison != 0) {
3032
        return lastComparison;
3033
      }
3034
      if (isSetPex()) {
3035
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
3036
        if (lastComparison != 0) {
3037
          return lastComparison;
3038
        }
3039
      }
3040
      return 0;
3041
    }
3042
 
3043
    public _Fields fieldForId(int fieldId) {
3044
      return _Fields.findByThriftId(fieldId);
3045
    }
3046
 
3047
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
3048
      org.apache.thrift.protocol.TField field;
3049
      iprot.readStructBegin();
3050
      while (true)
3051
      {
3052
        field = iprot.readFieldBegin();
3053
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3054
          break;
3055
        }
3056
        switch (field.id) {
3057
          case 0: // SUCCESS
3058
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
3059
              this.success = new Coupon();
3060
              this.success.read(iprot);
3061
            } else { 
3062
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3063
            }
3064
            break;
3065
          case 1: // PEX
3066
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
3067
              this.pex = new PromotionException();
3068
              this.pex.read(iprot);
3069
            } else { 
3070
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3071
            }
3072
            break;
3073
          default:
3074
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3075
        }
3076
        iprot.readFieldEnd();
3077
      }
3078
      iprot.readStructEnd();
3079
      validate();
3080
    }
3081
 
3082
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3083
      oprot.writeStructBegin(STRUCT_DESC);
3084
 
3085
      if (this.isSetSuccess()) {
3086
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
3087
        this.success.write(oprot);
3088
        oprot.writeFieldEnd();
3089
      } else if (this.isSetPex()) {
3090
        oprot.writeFieldBegin(PEX_FIELD_DESC);
3091
        this.pex.write(oprot);
3092
        oprot.writeFieldEnd();
3093
      }
3094
      oprot.writeFieldStop();
3095
      oprot.writeStructEnd();
3096
    }
3097
 
3098
    @Override
3099
    public String toString() {
3100
      StringBuilder sb = new StringBuilder("getCoupon_result(");
3101
      boolean first = true;
3102
 
3103
      sb.append("success:");
3104
      if (this.success == null) {
3105
        sb.append("null");
3106
      } else {
3107
        sb.append(this.success);
3108
      }
3109
      first = false;
3110
      if (!first) sb.append(", ");
3111
      sb.append("pex:");
3112
      if (this.pex == null) {
3113
        sb.append("null");
3114
      } else {
3115
        sb.append(this.pex);
3116
      }
3117
      first = false;
3118
      sb.append(")");
3119
      return sb.toString();
3120
    }
3121
 
3122
    public void validate() throws org.apache.thrift.TException {
3123
      // check for required fields
3124
    }
3125
 
3126
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
3127
      try {
3128
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
3129
      } catch (org.apache.thrift.TException te) {
3130
        throw new java.io.IOException(te);
3131
      }
3132
    }
3133
 
3134
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
3135
      try {
3136
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
3137
      } catch (org.apache.thrift.TException te) {
3138
        throw new java.io.IOException(te);
3139
      }
3140
    }
3141
 
3142
  }
3143
 
3144
  public static class isGiftVoucher_args implements org.apache.thrift.TBase<isGiftVoucher_args, isGiftVoucher_args._Fields>, java.io.Serializable, Cloneable   {
3145
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isGiftVoucher_args");
3146
 
3147
    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);
3148
 
3149
    private String couponCode; // required
3150
 
3151
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3152
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3153
      COUPON_CODE((short)1, "couponCode");
3154
 
3155
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3156
 
3157
      static {
3158
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3159
          byName.put(field.getFieldName(), field);
3160
        }
3161
      }
3162
 
3163
      /**
3164
       * Find the _Fields constant that matches fieldId, or null if its not found.
3165
       */
3166
      public static _Fields findByThriftId(int fieldId) {
3167
        switch(fieldId) {
3168
          case 1: // COUPON_CODE
3169
            return COUPON_CODE;
3170
          default:
3171
            return null;
3172
        }
3173
      }
3174
 
3175
      /**
3176
       * Find the _Fields constant that matches fieldId, throwing an exception
3177
       * if it is not found.
3178
       */
3179
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3180
        _Fields fields = findByThriftId(fieldId);
3181
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3182
        return fields;
3183
      }
3184
 
3185
      /**
3186
       * Find the _Fields constant that matches name, or null if its not found.
3187
       */
3188
      public static _Fields findByName(String name) {
3189
        return byName.get(name);
3190
      }
3191
 
3192
      private final short _thriftId;
3193
      private final String _fieldName;
3194
 
3195
      _Fields(short thriftId, String fieldName) {
3196
        _thriftId = thriftId;
3197
        _fieldName = fieldName;
3198
      }
3199
 
3200
      public short getThriftFieldId() {
3201
        return _thriftId;
3202
      }
3203
 
3204
      public String getFieldName() {
3205
        return _fieldName;
3206
      }
3207
    }
3208
 
3209
    // isset id assignments
3210
 
3211
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3212
    static {
3213
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
3214
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3215
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
3216
      metaDataMap = Collections.unmodifiableMap(tmpMap);
3217
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isGiftVoucher_args.class, metaDataMap);
3218
    }
3219
 
3220
    public isGiftVoucher_args() {
3221
    }
3222
 
3223
    public isGiftVoucher_args(
3224
      String couponCode)
3225
    {
3226
      this();
3227
      this.couponCode = couponCode;
3228
    }
3229
 
3230
    /**
3231
     * Performs a deep copy on <i>other</i>.
3232
     */
3233
    public isGiftVoucher_args(isGiftVoucher_args other) {
3234
      if (other.isSetCouponCode()) {
3235
        this.couponCode = other.couponCode;
3236
      }
3237
    }
3238
 
3239
    public isGiftVoucher_args deepCopy() {
3240
      return new isGiftVoucher_args(this);
3241
    }
3242
 
3243
    @Override
3244
    public void clear() {
3245
      this.couponCode = null;
3246
    }
3247
 
3248
    public String getCouponCode() {
3249
      return this.couponCode;
3250
    }
3251
 
3252
    public void setCouponCode(String couponCode) {
3253
      this.couponCode = couponCode;
3254
    }
3255
 
3256
    public void unsetCouponCode() {
3257
      this.couponCode = null;
3258
    }
3259
 
3260
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
3261
    public boolean isSetCouponCode() {
3262
      return this.couponCode != null;
3263
    }
3264
 
3265
    public void setCouponCodeIsSet(boolean value) {
3266
      if (!value) {
3267
        this.couponCode = null;
3268
      }
3269
    }
3270
 
3271
    public void setFieldValue(_Fields field, Object value) {
3272
      switch (field) {
3273
      case COUPON_CODE:
3274
        if (value == null) {
3275
          unsetCouponCode();
3276
        } else {
3277
          setCouponCode((String)value);
3278
        }
3279
        break;
3280
 
3281
      }
3282
    }
3283
 
3284
    public Object getFieldValue(_Fields field) {
3285
      switch (field) {
3286
      case COUPON_CODE:
3287
        return getCouponCode();
3288
 
3289
      }
3290
      throw new IllegalStateException();
3291
    }
3292
 
3293
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
3294
    public boolean isSet(_Fields field) {
3295
      if (field == null) {
3296
        throw new IllegalArgumentException();
3297
      }
3298
 
3299
      switch (field) {
3300
      case COUPON_CODE:
3301
        return isSetCouponCode();
3302
      }
3303
      throw new IllegalStateException();
3304
    }
3305
 
3306
    @Override
3307
    public boolean equals(Object that) {
3308
      if (that == null)
3309
        return false;
3310
      if (that instanceof isGiftVoucher_args)
3311
        return this.equals((isGiftVoucher_args)that);
3312
      return false;
3313
    }
3314
 
3315
    public boolean equals(isGiftVoucher_args that) {
3316
      if (that == null)
3317
        return false;
3318
 
3319
      boolean this_present_couponCode = true && this.isSetCouponCode();
3320
      boolean that_present_couponCode = true && that.isSetCouponCode();
3321
      if (this_present_couponCode || that_present_couponCode) {
3322
        if (!(this_present_couponCode && that_present_couponCode))
3323
          return false;
3324
        if (!this.couponCode.equals(that.couponCode))
3325
          return false;
3326
      }
3327
 
3328
      return true;
3329
    }
3330
 
3331
    @Override
3332
    public int hashCode() {
3333
      return 0;
3334
    }
3335
 
3336
    public int compareTo(isGiftVoucher_args other) {
3337
      if (!getClass().equals(other.getClass())) {
3338
        return getClass().getName().compareTo(other.getClass().getName());
3339
      }
3340
 
3341
      int lastComparison = 0;
3342
      isGiftVoucher_args typedOther = (isGiftVoucher_args)other;
3343
 
3344
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
3345
      if (lastComparison != 0) {
3346
        return lastComparison;
3347
      }
3348
      if (isSetCouponCode()) {
3349
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
3350
        if (lastComparison != 0) {
3351
          return lastComparison;
3352
        }
3353
      }
3354
      return 0;
3355
    }
3356
 
3357
    public _Fields fieldForId(int fieldId) {
3358
      return _Fields.findByThriftId(fieldId);
3359
    }
3360
 
3361
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
3362
      org.apache.thrift.protocol.TField field;
3363
      iprot.readStructBegin();
3364
      while (true)
3365
      {
3366
        field = iprot.readFieldBegin();
3367
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3368
          break;
3369
        }
3370
        switch (field.id) {
3371
          case 1: // COUPON_CODE
3372
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
3373
              this.couponCode = iprot.readString();
3374
            } else { 
3375
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3376
            }
3377
            break;
3378
          default:
3379
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3380
        }
3381
        iprot.readFieldEnd();
3382
      }
3383
      iprot.readStructEnd();
3384
      validate();
3385
    }
3386
 
3387
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3388
      validate();
3389
 
3390
      oprot.writeStructBegin(STRUCT_DESC);
3391
      if (this.couponCode != null) {
3392
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
3393
        oprot.writeString(this.couponCode);
3394
        oprot.writeFieldEnd();
3395
      }
3396
      oprot.writeFieldStop();
3397
      oprot.writeStructEnd();
3398
    }
3399
 
3400
    @Override
3401
    public String toString() {
3402
      StringBuilder sb = new StringBuilder("isGiftVoucher_args(");
3403
      boolean first = true;
3404
 
3405
      sb.append("couponCode:");
3406
      if (this.couponCode == null) {
3407
        sb.append("null");
3408
      } else {
3409
        sb.append(this.couponCode);
3410
      }
3411
      first = false;
3412
      sb.append(")");
3413
      return sb.toString();
3414
    }
3415
 
3416
    public void validate() throws org.apache.thrift.TException {
3417
      // check for required fields
3418
    }
3419
 
3420
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
3421
      try {
3422
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
3423
      } catch (org.apache.thrift.TException te) {
3424
        throw new java.io.IOException(te);
3425
      }
3426
    }
3427
 
3428
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
3429
      try {
3430
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
3431
      } catch (org.apache.thrift.TException te) {
3432
        throw new java.io.IOException(te);
3433
      }
3434
    }
3435
 
3436
  }
3437
 
3438
  public static class isGiftVoucher_result implements org.apache.thrift.TBase<isGiftVoucher_result, isGiftVoucher_result._Fields>, java.io.Serializable, Cloneable   {
3439
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isGiftVoucher_result");
3440
 
3441
    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);
3442
    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);
3443
 
3444
    private boolean success; // required
3445
    private PromotionException pex; // required
3446
 
3447
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3448
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3449
      SUCCESS((short)0, "success"),
3450
      PEX((short)1, "pex");
3451
 
3452
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3453
 
3454
      static {
3455
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3456
          byName.put(field.getFieldName(), field);
3457
        }
3458
      }
3459
 
3460
      /**
3461
       * Find the _Fields constant that matches fieldId, or null if its not found.
3462
       */
3463
      public static _Fields findByThriftId(int fieldId) {
3464
        switch(fieldId) {
3465
          case 0: // SUCCESS
3466
            return SUCCESS;
3467
          case 1: // PEX
3468
            return PEX;
3469
          default:
3470
            return null;
3471
        }
3472
      }
3473
 
3474
      /**
3475
       * Find the _Fields constant that matches fieldId, throwing an exception
3476
       * if it is not found.
3477
       */
3478
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3479
        _Fields fields = findByThriftId(fieldId);
3480
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3481
        return fields;
3482
      }
3483
 
3484
      /**
3485
       * Find the _Fields constant that matches name, or null if its not found.
3486
       */
3487
      public static _Fields findByName(String name) {
3488
        return byName.get(name);
3489
      }
3490
 
3491
      private final short _thriftId;
3492
      private final String _fieldName;
3493
 
3494
      _Fields(short thriftId, String fieldName) {
3495
        _thriftId = thriftId;
3496
        _fieldName = fieldName;
3497
      }
3498
 
3499
      public short getThriftFieldId() {
3500
        return _thriftId;
3501
      }
3502
 
3503
      public String getFieldName() {
3504
        return _fieldName;
3505
      }
3506
    }
3507
 
3508
    // isset id assignments
3509
    private static final int __SUCCESS_ISSET_ID = 0;
3510
    private BitSet __isset_bit_vector = new BitSet(1);
3511
 
3512
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3513
    static {
3514
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
3515
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3516
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
3517
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3518
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
3519
      metaDataMap = Collections.unmodifiableMap(tmpMap);
3520
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isGiftVoucher_result.class, metaDataMap);
3521
    }
3522
 
3523
    public isGiftVoucher_result() {
3524
    }
3525
 
3526
    public isGiftVoucher_result(
3527
      boolean success,
3528
      PromotionException pex)
3529
    {
3530
      this();
3531
      this.success = success;
3532
      setSuccessIsSet(true);
3533
      this.pex = pex;
3534
    }
3535
 
3536
    /**
3537
     * Performs a deep copy on <i>other</i>.
3538
     */
3539
    public isGiftVoucher_result(isGiftVoucher_result other) {
3540
      __isset_bit_vector.clear();
3541
      __isset_bit_vector.or(other.__isset_bit_vector);
3542
      this.success = other.success;
3543
      if (other.isSetPex()) {
3544
        this.pex = new PromotionException(other.pex);
3545
      }
3546
    }
3547
 
3548
    public isGiftVoucher_result deepCopy() {
3549
      return new isGiftVoucher_result(this);
3550
    }
3551
 
3552
    @Override
3553
    public void clear() {
3554
      setSuccessIsSet(false);
3555
      this.success = false;
3556
      this.pex = null;
3557
    }
3558
 
3559
    public boolean isSuccess() {
3560
      return this.success;
3561
    }
3562
 
3563
    public void setSuccess(boolean success) {
3564
      this.success = success;
3565
      setSuccessIsSet(true);
3566
    }
3567
 
3568
    public void unsetSuccess() {
3569
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
3570
    }
3571
 
3572
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3573
    public boolean isSetSuccess() {
3574
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
3575
    }
3576
 
3577
    public void setSuccessIsSet(boolean value) {
3578
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
3579
    }
3580
 
3581
    public PromotionException getPex() {
3582
      return this.pex;
3583
    }
3584
 
3585
    public void setPex(PromotionException pex) {
3586
      this.pex = pex;
3587
    }
3588
 
3589
    public void unsetPex() {
3590
      this.pex = null;
3591
    }
3592
 
3593
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
3594
    public boolean isSetPex() {
3595
      return this.pex != null;
3596
    }
3597
 
3598
    public void setPexIsSet(boolean value) {
3599
      if (!value) {
3600
        this.pex = null;
3601
      }
3602
    }
3603
 
3604
    public void setFieldValue(_Fields field, Object value) {
3605
      switch (field) {
3606
      case SUCCESS:
3607
        if (value == null) {
3608
          unsetSuccess();
3609
        } else {
3610
          setSuccess((Boolean)value);
3611
        }
3612
        break;
3613
 
3614
      case PEX:
3615
        if (value == null) {
3616
          unsetPex();
3617
        } else {
3618
          setPex((PromotionException)value);
3619
        }
3620
        break;
3621
 
3622
      }
3623
    }
3624
 
3625
    public Object getFieldValue(_Fields field) {
3626
      switch (field) {
3627
      case SUCCESS:
3628
        return Boolean.valueOf(isSuccess());
3629
 
3630
      case PEX:
3631
        return getPex();
3632
 
3633
      }
3634
      throw new IllegalStateException();
3635
    }
3636
 
3637
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
3638
    public boolean isSet(_Fields field) {
3639
      if (field == null) {
3640
        throw new IllegalArgumentException();
3641
      }
3642
 
3643
      switch (field) {
3644
      case SUCCESS:
3645
        return isSetSuccess();
3646
      case PEX:
3647
        return isSetPex();
3648
      }
3649
      throw new IllegalStateException();
3650
    }
3651
 
3652
    @Override
3653
    public boolean equals(Object that) {
3654
      if (that == null)
3655
        return false;
3656
      if (that instanceof isGiftVoucher_result)
3657
        return this.equals((isGiftVoucher_result)that);
3658
      return false;
3659
    }
3660
 
3661
    public boolean equals(isGiftVoucher_result that) {
3662
      if (that == null)
3663
        return false;
3664
 
3665
      boolean this_present_success = true;
3666
      boolean that_present_success = true;
3667
      if (this_present_success || that_present_success) {
3668
        if (!(this_present_success && that_present_success))
3669
          return false;
3670
        if (this.success != that.success)
3671
          return false;
3672
      }
3673
 
3674
      boolean this_present_pex = true && this.isSetPex();
3675
      boolean that_present_pex = true && that.isSetPex();
3676
      if (this_present_pex || that_present_pex) {
3677
        if (!(this_present_pex && that_present_pex))
3678
          return false;
3679
        if (!this.pex.equals(that.pex))
3680
          return false;
3681
      }
3682
 
3683
      return true;
3684
    }
3685
 
3686
    @Override
3687
    public int hashCode() {
3688
      return 0;
3689
    }
3690
 
3691
    public int compareTo(isGiftVoucher_result other) {
3692
      if (!getClass().equals(other.getClass())) {
3693
        return getClass().getName().compareTo(other.getClass().getName());
3694
      }
3695
 
3696
      int lastComparison = 0;
3697
      isGiftVoucher_result typedOther = (isGiftVoucher_result)other;
3698
 
3699
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3700
      if (lastComparison != 0) {
3701
        return lastComparison;
3702
      }
3703
      if (isSetSuccess()) {
3704
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
3705
        if (lastComparison != 0) {
3706
          return lastComparison;
3707
        }
3708
      }
3709
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
3710
      if (lastComparison != 0) {
3711
        return lastComparison;
3712
      }
3713
      if (isSetPex()) {
3714
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
3715
        if (lastComparison != 0) {
3716
          return lastComparison;
3717
        }
3718
      }
3719
      return 0;
3720
    }
3721
 
3722
    public _Fields fieldForId(int fieldId) {
3723
      return _Fields.findByThriftId(fieldId);
3724
    }
3725
 
3726
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
3727
      org.apache.thrift.protocol.TField field;
3728
      iprot.readStructBegin();
3729
      while (true)
3730
      {
3731
        field = iprot.readFieldBegin();
3732
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3733
          break;
3734
        }
3735
        switch (field.id) {
3736
          case 0: // SUCCESS
3737
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
3738
              this.success = iprot.readBool();
3739
              setSuccessIsSet(true);
3740
            } else { 
3741
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3742
            }
3743
            break;
3744
          case 1: // PEX
3745
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
3746
              this.pex = new PromotionException();
3747
              this.pex.read(iprot);
3748
            } else { 
3749
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3750
            }
3751
            break;
3752
          default:
3753
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3754
        }
3755
        iprot.readFieldEnd();
3756
      }
3757
      iprot.readStructEnd();
3758
      validate();
3759
    }
3760
 
3761
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3762
      oprot.writeStructBegin(STRUCT_DESC);
3763
 
3764
      if (this.isSetSuccess()) {
3765
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
3766
        oprot.writeBool(this.success);
3767
        oprot.writeFieldEnd();
3768
      } else if (this.isSetPex()) {
3769
        oprot.writeFieldBegin(PEX_FIELD_DESC);
3770
        this.pex.write(oprot);
3771
        oprot.writeFieldEnd();
3772
      }
3773
      oprot.writeFieldStop();
3774
      oprot.writeStructEnd();
3775
    }
3776
 
3777
    @Override
3778
    public String toString() {
3779
      StringBuilder sb = new StringBuilder("isGiftVoucher_result(");
3780
      boolean first = true;
3781
 
3782
      sb.append("success:");
3783
      sb.append(this.success);
3784
      first = false;
3785
      if (!first) sb.append(", ");
3786
      sb.append("pex:");
3787
      if (this.pex == null) {
3788
        sb.append("null");
3789
      } else {
3790
        sb.append(this.pex);
3791
      }
3792
      first = false;
3793
      sb.append(")");
3794
      return sb.toString();
3795
    }
3796
 
3797
    public void validate() throws org.apache.thrift.TException {
3798
      // check for required fields
3799
    }
3800
 
3801
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
3802
      try {
3803
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
3804
      } catch (org.apache.thrift.TException te) {
3805
        throw new java.io.IOException(te);
3806
      }
3807
    }
3808
 
3809
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
3810
      try {
3811
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
3812
      } catch (org.apache.thrift.TException te) {
3813
        throw new java.io.IOException(te);
3814
      }
3815
    }
3816
 
3817
  }
3818
 
3430 rajveer 3819
  public static class getAllPromotions_args implements org.apache.thrift.TBase<getAllPromotions_args, getAllPromotions_args._Fields>, java.io.Serializable, Cloneable   {
3820
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllPromotions_args");
1982 varun.gupt 3821
 
3822
 
3823
 
3824
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 3825
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 3826
;
3827
 
3828
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3829
 
3830
      static {
3831
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3832
          byName.put(field.getFieldName(), field);
3833
        }
3834
      }
3835
 
3836
      /**
3837
       * Find the _Fields constant that matches fieldId, or null if its not found.
3838
       */
3839
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 3840
        switch(fieldId) {
3841
          default:
3842
            return null;
3843
        }
1982 varun.gupt 3844
      }
3845
 
3846
      /**
3847
       * Find the _Fields constant that matches fieldId, throwing an exception
3848
       * if it is not found.
3849
       */
3850
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3851
        _Fields fields = findByThriftId(fieldId);
3852
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3853
        return fields;
3854
      }
3855
 
3856
      /**
3857
       * Find the _Fields constant that matches name, or null if its not found.
3858
       */
3859
      public static _Fields findByName(String name) {
3860
        return byName.get(name);
3861
      }
3862
 
3863
      private final short _thriftId;
3864
      private final String _fieldName;
3865
 
3866
      _Fields(short thriftId, String fieldName) {
3867
        _thriftId = thriftId;
3868
        _fieldName = fieldName;
3869
      }
3870
 
3871
      public short getThriftFieldId() {
3872
        return _thriftId;
3873
      }
3874
 
3875
      public String getFieldName() {
3876
        return _fieldName;
3877
      }
3878
    }
3430 rajveer 3879
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 3880
    static {
3430 rajveer 3881
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
3882
      metaDataMap = Collections.unmodifiableMap(tmpMap);
3883
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllPromotions_args.class, metaDataMap);
1982 varun.gupt 3884
    }
3885
 
3886
    public getAllPromotions_args() {
3887
    }
3888
 
3889
    /**
3890
     * Performs a deep copy on <i>other</i>.
3891
     */
3892
    public getAllPromotions_args(getAllPromotions_args other) {
3893
    }
3894
 
3895
    public getAllPromotions_args deepCopy() {
3896
      return new getAllPromotions_args(this);
3897
    }
3898
 
3430 rajveer 3899
    @Override
3900
    public void clear() {
1982 varun.gupt 3901
    }
3902
 
3903
    public void setFieldValue(_Fields field, Object value) {
3904
      switch (field) {
3905
      }
3906
    }
3907
 
3908
    public Object getFieldValue(_Fields field) {
3909
      switch (field) {
3910
      }
3911
      throw new IllegalStateException();
3912
    }
3913
 
3430 rajveer 3914
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
3915
    public boolean isSet(_Fields field) {
3916
      if (field == null) {
3917
        throw new IllegalArgumentException();
3918
      }
1982 varun.gupt 3919
 
3920
      switch (field) {
3921
      }
3922
      throw new IllegalStateException();
3923
    }
3924
 
3925
    @Override
3926
    public boolean equals(Object that) {
3927
      if (that == null)
3928
        return false;
3929
      if (that instanceof getAllPromotions_args)
3930
        return this.equals((getAllPromotions_args)that);
3931
      return false;
3932
    }
3933
 
3934
    public boolean equals(getAllPromotions_args that) {
3935
      if (that == null)
3936
        return false;
3937
 
3938
      return true;
3939
    }
3940
 
3941
    @Override
3942
    public int hashCode() {
3943
      return 0;
3944
    }
3945
 
3946
    public int compareTo(getAllPromotions_args other) {
3947
      if (!getClass().equals(other.getClass())) {
3948
        return getClass().getName().compareTo(other.getClass().getName());
3949
      }
3950
 
3951
      int lastComparison = 0;
3952
      getAllPromotions_args typedOther = (getAllPromotions_args)other;
3953
 
3954
      return 0;
3955
    }
3956
 
3430 rajveer 3957
    public _Fields fieldForId(int fieldId) {
3958
      return _Fields.findByThriftId(fieldId);
3959
    }
3960
 
3961
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
3962
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 3963
      iprot.readStructBegin();
3964
      while (true)
3965
      {
3966
        field = iprot.readFieldBegin();
3430 rajveer 3967
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 3968
          break;
3969
        }
3430 rajveer 3970
        switch (field.id) {
3971
          default:
3972
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 3973
        }
3430 rajveer 3974
        iprot.readFieldEnd();
1982 varun.gupt 3975
      }
3976
      iprot.readStructEnd();
3977
      validate();
3978
    }
3979
 
3430 rajveer 3980
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 3981
      validate();
3982
 
3983
      oprot.writeStructBegin(STRUCT_DESC);
3984
      oprot.writeFieldStop();
3985
      oprot.writeStructEnd();
3986
    }
3987
 
3988
    @Override
3989
    public String toString() {
3990
      StringBuilder sb = new StringBuilder("getAllPromotions_args(");
3991
      boolean first = true;
3992
 
3993
      sb.append(")");
3994
      return sb.toString();
3995
    }
3996
 
3430 rajveer 3997
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 3998
      // check for required fields
3999
    }
4000
 
3430 rajveer 4001
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
4002
      try {
4003
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
4004
      } catch (org.apache.thrift.TException te) {
4005
        throw new java.io.IOException(te);
4006
      }
4007
    }
4008
 
4009
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
4010
      try {
4011
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
4012
      } catch (org.apache.thrift.TException te) {
4013
        throw new java.io.IOException(te);
4014
      }
4015
    }
4016
 
1982 varun.gupt 4017
  }
4018
 
3430 rajveer 4019
  public static class getAllPromotions_result implements org.apache.thrift.TBase<getAllPromotions_result, getAllPromotions_result._Fields>, java.io.Serializable, Cloneable   {
4020
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllPromotions_result");
1982 varun.gupt 4021
 
3430 rajveer 4022
    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);
4023
    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 4024
 
3430 rajveer 4025
    private List<Promotion> success; // required
4026
    private PromotionException pex; // required
1982 varun.gupt 4027
 
4028
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 4029
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 4030
      SUCCESS((short)0, "success"),
4031
      PEX((short)1, "pex");
4032
 
4033
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4034
 
4035
      static {
4036
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4037
          byName.put(field.getFieldName(), field);
4038
        }
4039
      }
4040
 
4041
      /**
4042
       * Find the _Fields constant that matches fieldId, or null if its not found.
4043
       */
4044
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 4045
        switch(fieldId) {
4046
          case 0: // SUCCESS
4047
            return SUCCESS;
4048
          case 1: // PEX
4049
            return PEX;
4050
          default:
4051
            return null;
4052
        }
1982 varun.gupt 4053
      }
4054
 
4055
      /**
4056
       * Find the _Fields constant that matches fieldId, throwing an exception
4057
       * if it is not found.
4058
       */
4059
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4060
        _Fields fields = findByThriftId(fieldId);
4061
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4062
        return fields;
4063
      }
4064
 
4065
      /**
4066
       * Find the _Fields constant that matches name, or null if its not found.
4067
       */
4068
      public static _Fields findByName(String name) {
4069
        return byName.get(name);
4070
      }
4071
 
4072
      private final short _thriftId;
4073
      private final String _fieldName;
4074
 
4075
      _Fields(short thriftId, String fieldName) {
4076
        _thriftId = thriftId;
4077
        _fieldName = fieldName;
4078
      }
4079
 
4080
      public short getThriftFieldId() {
4081
        return _thriftId;
4082
      }
4083
 
4084
      public String getFieldName() {
4085
        return _fieldName;
4086
      }
4087
    }
4088
 
4089
    // isset id assignments
4090
 
3430 rajveer 4091
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 4092
    static {
3430 rajveer 4093
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
4094
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4095
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
4096
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Promotion.class))));
4097
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4098
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
4099
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4100
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllPromotions_result.class, metaDataMap);
1982 varun.gupt 4101
    }
4102
 
4103
    public getAllPromotions_result() {
4104
    }
4105
 
4106
    public getAllPromotions_result(
4107
      List<Promotion> success,
4108
      PromotionException pex)
4109
    {
4110
      this();
4111
      this.success = success;
4112
      this.pex = pex;
4113
    }
4114
 
4115
    /**
4116
     * Performs a deep copy on <i>other</i>.
4117
     */
4118
    public getAllPromotions_result(getAllPromotions_result other) {
4119
      if (other.isSetSuccess()) {
4120
        List<Promotion> __this__success = new ArrayList<Promotion>();
4121
        for (Promotion other_element : other.success) {
4122
          __this__success.add(new Promotion(other_element));
4123
        }
4124
        this.success = __this__success;
4125
      }
4126
      if (other.isSetPex()) {
4127
        this.pex = new PromotionException(other.pex);
4128
      }
4129
    }
4130
 
4131
    public getAllPromotions_result deepCopy() {
4132
      return new getAllPromotions_result(this);
4133
    }
4134
 
3430 rajveer 4135
    @Override
4136
    public void clear() {
4137
      this.success = null;
4138
      this.pex = null;
1982 varun.gupt 4139
    }
4140
 
4141
    public int getSuccessSize() {
4142
      return (this.success == null) ? 0 : this.success.size();
4143
    }
4144
 
4145
    public java.util.Iterator<Promotion> getSuccessIterator() {
4146
      return (this.success == null) ? null : this.success.iterator();
4147
    }
4148
 
4149
    public void addToSuccess(Promotion elem) {
4150
      if (this.success == null) {
4151
        this.success = new ArrayList<Promotion>();
4152
      }
4153
      this.success.add(elem);
4154
    }
4155
 
4156
    public List<Promotion> getSuccess() {
4157
      return this.success;
4158
    }
4159
 
3430 rajveer 4160
    public void setSuccess(List<Promotion> success) {
1982 varun.gupt 4161
      this.success = success;
4162
    }
4163
 
4164
    public void unsetSuccess() {
4165
      this.success = null;
4166
    }
4167
 
3430 rajveer 4168
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 4169
    public boolean isSetSuccess() {
4170
      return this.success != null;
4171
    }
4172
 
4173
    public void setSuccessIsSet(boolean value) {
4174
      if (!value) {
4175
        this.success = null;
4176
      }
4177
    }
4178
 
4179
    public PromotionException getPex() {
4180
      return this.pex;
4181
    }
4182
 
3430 rajveer 4183
    public void setPex(PromotionException pex) {
1982 varun.gupt 4184
      this.pex = pex;
4185
    }
4186
 
4187
    public void unsetPex() {
4188
      this.pex = null;
4189
    }
4190
 
3430 rajveer 4191
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 4192
    public boolean isSetPex() {
4193
      return this.pex != null;
4194
    }
4195
 
4196
    public void setPexIsSet(boolean value) {
4197
      if (!value) {
4198
        this.pex = null;
4199
      }
4200
    }
4201
 
4202
    public void setFieldValue(_Fields field, Object value) {
4203
      switch (field) {
4204
      case SUCCESS:
4205
        if (value == null) {
4206
          unsetSuccess();
4207
        } else {
4208
          setSuccess((List<Promotion>)value);
4209
        }
4210
        break;
4211
 
4212
      case PEX:
4213
        if (value == null) {
4214
          unsetPex();
4215
        } else {
4216
          setPex((PromotionException)value);
4217
        }
4218
        break;
4219
 
4220
      }
4221
    }
4222
 
4223
    public Object getFieldValue(_Fields field) {
4224
      switch (field) {
4225
      case SUCCESS:
4226
        return getSuccess();
4227
 
4228
      case PEX:
4229
        return getPex();
4230
 
4231
      }
4232
      throw new IllegalStateException();
4233
    }
4234
 
3430 rajveer 4235
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
4236
    public boolean isSet(_Fields field) {
4237
      if (field == null) {
4238
        throw new IllegalArgumentException();
4239
      }
1982 varun.gupt 4240
 
4241
      switch (field) {
4242
      case SUCCESS:
4243
        return isSetSuccess();
4244
      case PEX:
4245
        return isSetPex();
4246
      }
4247
      throw new IllegalStateException();
4248
    }
4249
 
4250
    @Override
4251
    public boolean equals(Object that) {
4252
      if (that == null)
4253
        return false;
4254
      if (that instanceof getAllPromotions_result)
4255
        return this.equals((getAllPromotions_result)that);
4256
      return false;
4257
    }
4258
 
4259
    public boolean equals(getAllPromotions_result that) {
4260
      if (that == null)
4261
        return false;
4262
 
4263
      boolean this_present_success = true && this.isSetSuccess();
4264
      boolean that_present_success = true && that.isSetSuccess();
4265
      if (this_present_success || that_present_success) {
4266
        if (!(this_present_success && that_present_success))
4267
          return false;
4268
        if (!this.success.equals(that.success))
4269
          return false;
4270
      }
4271
 
4272
      boolean this_present_pex = true && this.isSetPex();
4273
      boolean that_present_pex = true && that.isSetPex();
4274
      if (this_present_pex || that_present_pex) {
4275
        if (!(this_present_pex && that_present_pex))
4276
          return false;
4277
        if (!this.pex.equals(that.pex))
4278
          return false;
4279
      }
4280
 
4281
      return true;
4282
    }
4283
 
4284
    @Override
4285
    public int hashCode() {
4286
      return 0;
4287
    }
4288
 
4289
    public int compareTo(getAllPromotions_result other) {
4290
      if (!getClass().equals(other.getClass())) {
4291
        return getClass().getName().compareTo(other.getClass().getName());
4292
      }
4293
 
4294
      int lastComparison = 0;
4295
      getAllPromotions_result typedOther = (getAllPromotions_result)other;
4296
 
3430 rajveer 4297
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 4298
      if (lastComparison != 0) {
4299
        return lastComparison;
4300
      }
3430 rajveer 4301
      if (isSetSuccess()) {
4302
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
4303
        if (lastComparison != 0) {
4304
          return lastComparison;
4305
        }
1982 varun.gupt 4306
      }
3430 rajveer 4307
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 4308
      if (lastComparison != 0) {
4309
        return lastComparison;
4310
      }
3430 rajveer 4311
      if (isSetPex()) {
4312
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
4313
        if (lastComparison != 0) {
4314
          return lastComparison;
4315
        }
1982 varun.gupt 4316
      }
4317
      return 0;
4318
    }
4319
 
3430 rajveer 4320
    public _Fields fieldForId(int fieldId) {
4321
      return _Fields.findByThriftId(fieldId);
4322
    }
4323
 
4324
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4325
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 4326
      iprot.readStructBegin();
4327
      while (true)
4328
      {
4329
        field = iprot.readFieldBegin();
3430 rajveer 4330
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 4331
          break;
4332
        }
3430 rajveer 4333
        switch (field.id) {
4334
          case 0: // SUCCESS
4335
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
4336
              {
5327 rajveer 4337
                org.apache.thrift.protocol.TList _list12 = iprot.readListBegin();
4338
                this.success = new ArrayList<Promotion>(_list12.size);
4339
                for (int _i13 = 0; _i13 < _list12.size; ++_i13)
1982 varun.gupt 4340
                {
5327 rajveer 4341
                  Promotion _elem14; // required
4342
                  _elem14 = new Promotion();
4343
                  _elem14.read(iprot);
4344
                  this.success.add(_elem14);
1982 varun.gupt 4345
                }
3430 rajveer 4346
                iprot.readListEnd();
1982 varun.gupt 4347
              }
3430 rajveer 4348
            } else { 
4349
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4350
            }
4351
            break;
4352
          case 1: // PEX
4353
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
4354
              this.pex = new PromotionException();
4355
              this.pex.read(iprot);
4356
            } else { 
4357
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4358
            }
4359
            break;
4360
          default:
4361
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 4362
        }
3430 rajveer 4363
        iprot.readFieldEnd();
1982 varun.gupt 4364
      }
4365
      iprot.readStructEnd();
4366
      validate();
4367
    }
4368
 
3430 rajveer 4369
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 4370
      oprot.writeStructBegin(STRUCT_DESC);
4371
 
4372
      if (this.isSetSuccess()) {
4373
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
4374
        {
3430 rajveer 4375
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
5327 rajveer 4376
          for (Promotion _iter15 : this.success)
1982 varun.gupt 4377
          {
5327 rajveer 4378
            _iter15.write(oprot);
1982 varun.gupt 4379
          }
4380
          oprot.writeListEnd();
4381
        }
4382
        oprot.writeFieldEnd();
4383
      } else if (this.isSetPex()) {
4384
        oprot.writeFieldBegin(PEX_FIELD_DESC);
4385
        this.pex.write(oprot);
4386
        oprot.writeFieldEnd();
4387
      }
4388
      oprot.writeFieldStop();
4389
      oprot.writeStructEnd();
4390
    }
4391
 
4392
    @Override
4393
    public String toString() {
4394
      StringBuilder sb = new StringBuilder("getAllPromotions_result(");
4395
      boolean first = true;
4396
 
4397
      sb.append("success:");
4398
      if (this.success == null) {
4399
        sb.append("null");
4400
      } else {
4401
        sb.append(this.success);
4402
      }
4403
      first = false;
4404
      if (!first) sb.append(", ");
4405
      sb.append("pex:");
4406
      if (this.pex == null) {
4407
        sb.append("null");
4408
      } else {
4409
        sb.append(this.pex);
4410
      }
4411
      first = false;
4412
      sb.append(")");
4413
      return sb.toString();
4414
    }
4415
 
3430 rajveer 4416
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 4417
      // check for required fields
4418
    }
4419
 
3430 rajveer 4420
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
4421
      try {
4422
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
4423
      } catch (org.apache.thrift.TException te) {
4424
        throw new java.io.IOException(te);
4425
      }
4426
    }
4427
 
4428
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
4429
      try {
4430
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
4431
      } catch (org.apache.thrift.TException te) {
4432
        throw new java.io.IOException(te);
4433
      }
4434
    }
4435
 
1982 varun.gupt 4436
  }
4437
 
3430 rajveer 4438
  public static class getPromotionById_args implements org.apache.thrift.TBase<getPromotionById_args, getPromotionById_args._Fields>, java.io.Serializable, Cloneable   {
4439
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPromotionById_args");
1982 varun.gupt 4440
 
3430 rajveer 4441
    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 4442
 
3430 rajveer 4443
    private long promotionId; // required
1982 varun.gupt 4444
 
4445
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 4446
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 4447
      PROMOTION_ID((short)1, "promotionId");
4448
 
4449
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4450
 
4451
      static {
4452
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4453
          byName.put(field.getFieldName(), field);
4454
        }
4455
      }
4456
 
4457
      /**
4458
       * Find the _Fields constant that matches fieldId, or null if its not found.
4459
       */
4460
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 4461
        switch(fieldId) {
4462
          case 1: // PROMOTION_ID
4463
            return PROMOTION_ID;
4464
          default:
4465
            return null;
4466
        }
1982 varun.gupt 4467
      }
4468
 
4469
      /**
4470
       * Find the _Fields constant that matches fieldId, throwing an exception
4471
       * if it is not found.
4472
       */
4473
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4474
        _Fields fields = findByThriftId(fieldId);
4475
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4476
        return fields;
4477
      }
4478
 
4479
      /**
4480
       * Find the _Fields constant that matches name, or null if its not found.
4481
       */
4482
      public static _Fields findByName(String name) {
4483
        return byName.get(name);
4484
      }
4485
 
4486
      private final short _thriftId;
4487
      private final String _fieldName;
4488
 
4489
      _Fields(short thriftId, String fieldName) {
4490
        _thriftId = thriftId;
4491
        _fieldName = fieldName;
4492
      }
4493
 
4494
      public short getThriftFieldId() {
4495
        return _thriftId;
4496
      }
4497
 
4498
      public String getFieldName() {
4499
        return _fieldName;
4500
      }
4501
    }
4502
 
4503
    // isset id assignments
4504
    private static final int __PROMOTIONID_ISSET_ID = 0;
4505
    private BitSet __isset_bit_vector = new BitSet(1);
4506
 
3430 rajveer 4507
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 4508
    static {
3430 rajveer 4509
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
4510
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4511
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
4512
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4513
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPromotionById_args.class, metaDataMap);
1982 varun.gupt 4514
    }
4515
 
4516
    public getPromotionById_args() {
4517
    }
4518
 
4519
    public getPromotionById_args(
4520
      long promotionId)
4521
    {
4522
      this();
4523
      this.promotionId = promotionId;
4524
      setPromotionIdIsSet(true);
4525
    }
4526
 
4527
    /**
4528
     * Performs a deep copy on <i>other</i>.
4529
     */
4530
    public getPromotionById_args(getPromotionById_args other) {
4531
      __isset_bit_vector.clear();
4532
      __isset_bit_vector.or(other.__isset_bit_vector);
4533
      this.promotionId = other.promotionId;
4534
    }
4535
 
4536
    public getPromotionById_args deepCopy() {
4537
      return new getPromotionById_args(this);
4538
    }
4539
 
3430 rajveer 4540
    @Override
4541
    public void clear() {
4542
      setPromotionIdIsSet(false);
4543
      this.promotionId = 0;
1982 varun.gupt 4544
    }
4545
 
4546
    public long getPromotionId() {
4547
      return this.promotionId;
4548
    }
4549
 
3430 rajveer 4550
    public void setPromotionId(long promotionId) {
1982 varun.gupt 4551
      this.promotionId = promotionId;
4552
      setPromotionIdIsSet(true);
4553
    }
4554
 
4555
    public void unsetPromotionId() {
4556
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
4557
    }
4558
 
3430 rajveer 4559
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 4560
    public boolean isSetPromotionId() {
4561
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
4562
    }
4563
 
4564
    public void setPromotionIdIsSet(boolean value) {
4565
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
4566
    }
4567
 
4568
    public void setFieldValue(_Fields field, Object value) {
4569
      switch (field) {
4570
      case PROMOTION_ID:
4571
        if (value == null) {
4572
          unsetPromotionId();
4573
        } else {
4574
          setPromotionId((Long)value);
4575
        }
4576
        break;
4577
 
4578
      }
4579
    }
4580
 
4581
    public Object getFieldValue(_Fields field) {
4582
      switch (field) {
4583
      case PROMOTION_ID:
3430 rajveer 4584
        return Long.valueOf(getPromotionId());
1982 varun.gupt 4585
 
4586
      }
4587
      throw new IllegalStateException();
4588
    }
4589
 
3430 rajveer 4590
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
4591
    public boolean isSet(_Fields field) {
4592
      if (field == null) {
4593
        throw new IllegalArgumentException();
4594
      }
1982 varun.gupt 4595
 
4596
      switch (field) {
4597
      case PROMOTION_ID:
4598
        return isSetPromotionId();
4599
      }
4600
      throw new IllegalStateException();
4601
    }
4602
 
4603
    @Override
4604
    public boolean equals(Object that) {
4605
      if (that == null)
4606
        return false;
4607
      if (that instanceof getPromotionById_args)
4608
        return this.equals((getPromotionById_args)that);
4609
      return false;
4610
    }
4611
 
4612
    public boolean equals(getPromotionById_args that) {
4613
      if (that == null)
4614
        return false;
4615
 
4616
      boolean this_present_promotionId = true;
4617
      boolean that_present_promotionId = true;
4618
      if (this_present_promotionId || that_present_promotionId) {
4619
        if (!(this_present_promotionId && that_present_promotionId))
4620
          return false;
4621
        if (this.promotionId != that.promotionId)
4622
          return false;
4623
      }
4624
 
4625
      return true;
4626
    }
4627
 
4628
    @Override
4629
    public int hashCode() {
4630
      return 0;
4631
    }
4632
 
4633
    public int compareTo(getPromotionById_args other) {
4634
      if (!getClass().equals(other.getClass())) {
4635
        return getClass().getName().compareTo(other.getClass().getName());
4636
      }
4637
 
4638
      int lastComparison = 0;
4639
      getPromotionById_args typedOther = (getPromotionById_args)other;
4640
 
3430 rajveer 4641
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
1982 varun.gupt 4642
      if (lastComparison != 0) {
4643
        return lastComparison;
4644
      }
3430 rajveer 4645
      if (isSetPromotionId()) {
4646
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
4647
        if (lastComparison != 0) {
4648
          return lastComparison;
4649
        }
1982 varun.gupt 4650
      }
4651
      return 0;
4652
    }
4653
 
3430 rajveer 4654
    public _Fields fieldForId(int fieldId) {
4655
      return _Fields.findByThriftId(fieldId);
4656
    }
4657
 
4658
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4659
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 4660
      iprot.readStructBegin();
4661
      while (true)
4662
      {
4663
        field = iprot.readFieldBegin();
3430 rajveer 4664
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 4665
          break;
4666
        }
3430 rajveer 4667
        switch (field.id) {
4668
          case 1: // PROMOTION_ID
4669
            if (field.type == org.apache.thrift.protocol.TType.I64) {
4670
              this.promotionId = iprot.readI64();
4671
              setPromotionIdIsSet(true);
4672
            } else { 
4673
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4674
            }
4675
            break;
4676
          default:
4677
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 4678
        }
3430 rajveer 4679
        iprot.readFieldEnd();
1982 varun.gupt 4680
      }
4681
      iprot.readStructEnd();
4682
      validate();
4683
    }
4684
 
3430 rajveer 4685
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 4686
      validate();
4687
 
4688
      oprot.writeStructBegin(STRUCT_DESC);
4689
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
4690
      oprot.writeI64(this.promotionId);
4691
      oprot.writeFieldEnd();
4692
      oprot.writeFieldStop();
4693
      oprot.writeStructEnd();
4694
    }
4695
 
4696
    @Override
4697
    public String toString() {
4698
      StringBuilder sb = new StringBuilder("getPromotionById_args(");
4699
      boolean first = true;
4700
 
4701
      sb.append("promotionId:");
4702
      sb.append(this.promotionId);
4703
      first = false;
4704
      sb.append(")");
4705
      return sb.toString();
4706
    }
4707
 
3430 rajveer 4708
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 4709
      // check for required fields
4710
    }
4711
 
3430 rajveer 4712
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
4713
      try {
4714
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
4715
      } catch (org.apache.thrift.TException te) {
4716
        throw new java.io.IOException(te);
4717
      }
4718
    }
4719
 
4720
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
4721
      try {
4722
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
4723
        __isset_bit_vector = new BitSet(1);
4724
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
4725
      } catch (org.apache.thrift.TException te) {
4726
        throw new java.io.IOException(te);
4727
      }
4728
    }
4729
 
1982 varun.gupt 4730
  }
4731
 
3430 rajveer 4732
  public static class getPromotionById_result implements org.apache.thrift.TBase<getPromotionById_result, getPromotionById_result._Fields>, java.io.Serializable, Cloneable   {
4733
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPromotionById_result");
1982 varun.gupt 4734
 
3430 rajveer 4735
    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);
4736
    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 4737
 
3430 rajveer 4738
    private Promotion success; // required
4739
    private PromotionException pex; // required
1982 varun.gupt 4740
 
4741
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 4742
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 4743
      SUCCESS((short)0, "success"),
4744
      PEX((short)1, "pex");
4745
 
4746
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4747
 
4748
      static {
4749
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4750
          byName.put(field.getFieldName(), field);
4751
        }
4752
      }
4753
 
4754
      /**
4755
       * Find the _Fields constant that matches fieldId, or null if its not found.
4756
       */
4757
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 4758
        switch(fieldId) {
4759
          case 0: // SUCCESS
4760
            return SUCCESS;
4761
          case 1: // PEX
4762
            return PEX;
4763
          default:
4764
            return null;
4765
        }
1982 varun.gupt 4766
      }
4767
 
4768
      /**
4769
       * Find the _Fields constant that matches fieldId, throwing an exception
4770
       * if it is not found.
4771
       */
4772
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4773
        _Fields fields = findByThriftId(fieldId);
4774
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4775
        return fields;
4776
      }
4777
 
4778
      /**
4779
       * Find the _Fields constant that matches name, or null if its not found.
4780
       */
4781
      public static _Fields findByName(String name) {
4782
        return byName.get(name);
4783
      }
4784
 
4785
      private final short _thriftId;
4786
      private final String _fieldName;
4787
 
4788
      _Fields(short thriftId, String fieldName) {
4789
        _thriftId = thriftId;
4790
        _fieldName = fieldName;
4791
      }
4792
 
4793
      public short getThriftFieldId() {
4794
        return _thriftId;
4795
      }
4796
 
4797
      public String getFieldName() {
4798
        return _fieldName;
4799
      }
4800
    }
4801
 
4802
    // isset id assignments
4803
 
3430 rajveer 4804
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 4805
    static {
3430 rajveer 4806
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
4807
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4808
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Promotion.class)));
4809
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4810
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
4811
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4812
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPromotionById_result.class, metaDataMap);
1982 varun.gupt 4813
    }
4814
 
4815
    public getPromotionById_result() {
4816
    }
4817
 
4818
    public getPromotionById_result(
4819
      Promotion success,
4820
      PromotionException pex)
4821
    {
4822
      this();
4823
      this.success = success;
4824
      this.pex = pex;
4825
    }
4826
 
4827
    /**
4828
     * Performs a deep copy on <i>other</i>.
4829
     */
4830
    public getPromotionById_result(getPromotionById_result other) {
4831
      if (other.isSetSuccess()) {
4832
        this.success = new Promotion(other.success);
4833
      }
4834
      if (other.isSetPex()) {
4835
        this.pex = new PromotionException(other.pex);
4836
      }
4837
    }
4838
 
4839
    public getPromotionById_result deepCopy() {
4840
      return new getPromotionById_result(this);
4841
    }
4842
 
3430 rajveer 4843
    @Override
4844
    public void clear() {
4845
      this.success = null;
4846
      this.pex = null;
1982 varun.gupt 4847
    }
4848
 
4849
    public Promotion getSuccess() {
4850
      return this.success;
4851
    }
4852
 
3430 rajveer 4853
    public void setSuccess(Promotion success) {
1982 varun.gupt 4854
      this.success = success;
4855
    }
4856
 
4857
    public void unsetSuccess() {
4858
      this.success = null;
4859
    }
4860
 
3430 rajveer 4861
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 4862
    public boolean isSetSuccess() {
4863
      return this.success != null;
4864
    }
4865
 
4866
    public void setSuccessIsSet(boolean value) {
4867
      if (!value) {
4868
        this.success = null;
4869
      }
4870
    }
4871
 
4872
    public PromotionException getPex() {
4873
      return this.pex;
4874
    }
4875
 
3430 rajveer 4876
    public void setPex(PromotionException pex) {
1982 varun.gupt 4877
      this.pex = pex;
4878
    }
4879
 
4880
    public void unsetPex() {
4881
      this.pex = null;
4882
    }
4883
 
3430 rajveer 4884
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 4885
    public boolean isSetPex() {
4886
      return this.pex != null;
4887
    }
4888
 
4889
    public void setPexIsSet(boolean value) {
4890
      if (!value) {
4891
        this.pex = null;
4892
      }
4893
    }
4894
 
4895
    public void setFieldValue(_Fields field, Object value) {
4896
      switch (field) {
4897
      case SUCCESS:
4898
        if (value == null) {
4899
          unsetSuccess();
4900
        } else {
4901
          setSuccess((Promotion)value);
4902
        }
4903
        break;
4904
 
4905
      case PEX:
4906
        if (value == null) {
4907
          unsetPex();
4908
        } else {
4909
          setPex((PromotionException)value);
4910
        }
4911
        break;
4912
 
4913
      }
4914
    }
4915
 
4916
    public Object getFieldValue(_Fields field) {
4917
      switch (field) {
4918
      case SUCCESS:
4919
        return getSuccess();
4920
 
4921
      case PEX:
4922
        return getPex();
4923
 
4924
      }
4925
      throw new IllegalStateException();
4926
    }
4927
 
3430 rajveer 4928
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
4929
    public boolean isSet(_Fields field) {
4930
      if (field == null) {
4931
        throw new IllegalArgumentException();
4932
      }
1982 varun.gupt 4933
 
4934
      switch (field) {
4935
      case SUCCESS:
4936
        return isSetSuccess();
4937
      case PEX:
4938
        return isSetPex();
4939
      }
4940
      throw new IllegalStateException();
4941
    }
4942
 
4943
    @Override
4944
    public boolean equals(Object that) {
4945
      if (that == null)
4946
        return false;
4947
      if (that instanceof getPromotionById_result)
4948
        return this.equals((getPromotionById_result)that);
4949
      return false;
4950
    }
4951
 
4952
    public boolean equals(getPromotionById_result that) {
4953
      if (that == null)
4954
        return false;
4955
 
4956
      boolean this_present_success = true && this.isSetSuccess();
4957
      boolean that_present_success = true && that.isSetSuccess();
4958
      if (this_present_success || that_present_success) {
4959
        if (!(this_present_success && that_present_success))
4960
          return false;
4961
        if (!this.success.equals(that.success))
4962
          return false;
4963
      }
4964
 
4965
      boolean this_present_pex = true && this.isSetPex();
4966
      boolean that_present_pex = true && that.isSetPex();
4967
      if (this_present_pex || that_present_pex) {
4968
        if (!(this_present_pex && that_present_pex))
4969
          return false;
4970
        if (!this.pex.equals(that.pex))
4971
          return false;
4972
      }
4973
 
4974
      return true;
4975
    }
4976
 
4977
    @Override
4978
    public int hashCode() {
4979
      return 0;
4980
    }
4981
 
4982
    public int compareTo(getPromotionById_result other) {
4983
      if (!getClass().equals(other.getClass())) {
4984
        return getClass().getName().compareTo(other.getClass().getName());
4985
      }
4986
 
4987
      int lastComparison = 0;
4988
      getPromotionById_result typedOther = (getPromotionById_result)other;
4989
 
3430 rajveer 4990
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 4991
      if (lastComparison != 0) {
4992
        return lastComparison;
4993
      }
3430 rajveer 4994
      if (isSetSuccess()) {
4995
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
4996
        if (lastComparison != 0) {
4997
          return lastComparison;
4998
        }
1982 varun.gupt 4999
      }
3430 rajveer 5000
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 5001
      if (lastComparison != 0) {
5002
        return lastComparison;
5003
      }
3430 rajveer 5004
      if (isSetPex()) {
5005
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
5006
        if (lastComparison != 0) {
5007
          return lastComparison;
5008
        }
1982 varun.gupt 5009
      }
5010
      return 0;
5011
    }
5012
 
3430 rajveer 5013
    public _Fields fieldForId(int fieldId) {
5014
      return _Fields.findByThriftId(fieldId);
5015
    }
5016
 
5017
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
5018
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 5019
      iprot.readStructBegin();
5020
      while (true)
5021
      {
5022
        field = iprot.readFieldBegin();
3430 rajveer 5023
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 5024
          break;
5025
        }
3430 rajveer 5026
        switch (field.id) {
5027
          case 0: // SUCCESS
5028
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
5029
              this.success = new Promotion();
5030
              this.success.read(iprot);
5031
            } else { 
5032
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5033
            }
5034
            break;
5035
          case 1: // PEX
5036
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
5037
              this.pex = new PromotionException();
5038
              this.pex.read(iprot);
5039
            } else { 
5040
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5041
            }
5042
            break;
5043
          default:
5044
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 5045
        }
3430 rajveer 5046
        iprot.readFieldEnd();
1982 varun.gupt 5047
      }
5048
      iprot.readStructEnd();
5049
      validate();
5050
    }
5051
 
3430 rajveer 5052
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 5053
      oprot.writeStructBegin(STRUCT_DESC);
5054
 
5055
      if (this.isSetSuccess()) {
5056
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
5057
        this.success.write(oprot);
5058
        oprot.writeFieldEnd();
5059
      } else if (this.isSetPex()) {
5060
        oprot.writeFieldBegin(PEX_FIELD_DESC);
5061
        this.pex.write(oprot);
5062
        oprot.writeFieldEnd();
5063
      }
5064
      oprot.writeFieldStop();
5065
      oprot.writeStructEnd();
5066
    }
5067
 
5068
    @Override
5069
    public String toString() {
5070
      StringBuilder sb = new StringBuilder("getPromotionById_result(");
5071
      boolean first = true;
5072
 
5073
      sb.append("success:");
5074
      if (this.success == null) {
5075
        sb.append("null");
5076
      } else {
5077
        sb.append(this.success);
5078
      }
5079
      first = false;
5080
      if (!first) sb.append(", ");
5081
      sb.append("pex:");
5082
      if (this.pex == null) {
5083
        sb.append("null");
5084
      } else {
5085
        sb.append(this.pex);
5086
      }
5087
      first = false;
5088
      sb.append(")");
5089
      return sb.toString();
5090
    }
5091
 
3430 rajveer 5092
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 5093
      // check for required fields
5094
    }
5095
 
3430 rajveer 5096
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5097
      try {
5098
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5099
      } catch (org.apache.thrift.TException te) {
5100
        throw new java.io.IOException(te);
5101
      }
5102
    }
5103
 
5104
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5105
      try {
5106
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5107
      } catch (org.apache.thrift.TException te) {
5108
        throw new java.io.IOException(te);
5109
      }
5110
    }
5111
 
1982 varun.gupt 5112
  }
5113
 
3430 rajveer 5114
  public static class generateCouponsForPromotion_args implements org.apache.thrift.TBase<generateCouponsForPromotion_args, generateCouponsForPromotion_args._Fields>, java.io.Serializable, Cloneable   {
5115
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("generateCouponsForPromotion_args");
1982 varun.gupt 5116
 
3430 rajveer 5117
    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);
5118
    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 5119
 
3430 rajveer 5120
    private long promotionId; // required
5121
    private String couponCode; // required
1982 varun.gupt 5122
 
5123
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 5124
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 5125
      PROMOTION_ID((short)1, "promotionId"),
5126
      COUPON_CODE((short)2, "couponCode");
5127
 
5128
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5129
 
5130
      static {
5131
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5132
          byName.put(field.getFieldName(), field);
5133
        }
5134
      }
5135
 
5136
      /**
5137
       * Find the _Fields constant that matches fieldId, or null if its not found.
5138
       */
5139
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 5140
        switch(fieldId) {
5141
          case 1: // PROMOTION_ID
5142
            return PROMOTION_ID;
5143
          case 2: // COUPON_CODE
5144
            return COUPON_CODE;
5145
          default:
5146
            return null;
5147
        }
1982 varun.gupt 5148
      }
5149
 
5150
      /**
5151
       * Find the _Fields constant that matches fieldId, throwing an exception
5152
       * if it is not found.
5153
       */
5154
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5155
        _Fields fields = findByThriftId(fieldId);
5156
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5157
        return fields;
5158
      }
5159
 
5160
      /**
5161
       * Find the _Fields constant that matches name, or null if its not found.
5162
       */
5163
      public static _Fields findByName(String name) {
5164
        return byName.get(name);
5165
      }
5166
 
5167
      private final short _thriftId;
5168
      private final String _fieldName;
5169
 
5170
      _Fields(short thriftId, String fieldName) {
5171
        _thriftId = thriftId;
5172
        _fieldName = fieldName;
5173
      }
5174
 
5175
      public short getThriftFieldId() {
5176
        return _thriftId;
5177
      }
5178
 
5179
      public String getFieldName() {
5180
        return _fieldName;
5181
      }
5182
    }
5183
 
5184
    // isset id assignments
5185
    private static final int __PROMOTIONID_ISSET_ID = 0;
5186
    private BitSet __isset_bit_vector = new BitSet(1);
5187
 
3430 rajveer 5188
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 5189
    static {
3430 rajveer 5190
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
5191
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5192
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
5193
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5194
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
5195
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5196
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(generateCouponsForPromotion_args.class, metaDataMap);
1982 varun.gupt 5197
    }
5198
 
5199
    public generateCouponsForPromotion_args() {
5200
    }
5201
 
5202
    public generateCouponsForPromotion_args(
5203
      long promotionId,
5204
      String couponCode)
5205
    {
5206
      this();
5207
      this.promotionId = promotionId;
5208
      setPromotionIdIsSet(true);
5209
      this.couponCode = couponCode;
5210
    }
5211
 
5212
    /**
5213
     * Performs a deep copy on <i>other</i>.
5214
     */
5215
    public generateCouponsForPromotion_args(generateCouponsForPromotion_args other) {
5216
      __isset_bit_vector.clear();
5217
      __isset_bit_vector.or(other.__isset_bit_vector);
5218
      this.promotionId = other.promotionId;
5219
      if (other.isSetCouponCode()) {
5220
        this.couponCode = other.couponCode;
5221
      }
5222
    }
5223
 
5224
    public generateCouponsForPromotion_args deepCopy() {
5225
      return new generateCouponsForPromotion_args(this);
5226
    }
5227
 
3430 rajveer 5228
    @Override
5229
    public void clear() {
5230
      setPromotionIdIsSet(false);
5231
      this.promotionId = 0;
5232
      this.couponCode = null;
1982 varun.gupt 5233
    }
5234
 
5235
    public long getPromotionId() {
5236
      return this.promotionId;
5237
    }
5238
 
3430 rajveer 5239
    public void setPromotionId(long promotionId) {
1982 varun.gupt 5240
      this.promotionId = promotionId;
5241
      setPromotionIdIsSet(true);
5242
    }
5243
 
5244
    public void unsetPromotionId() {
5245
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
5246
    }
5247
 
3430 rajveer 5248
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 5249
    public boolean isSetPromotionId() {
5250
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
5251
    }
5252
 
5253
    public void setPromotionIdIsSet(boolean value) {
5254
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
5255
    }
5256
 
5257
    public String getCouponCode() {
5258
      return this.couponCode;
5259
    }
5260
 
3430 rajveer 5261
    public void setCouponCode(String couponCode) {
1982 varun.gupt 5262
      this.couponCode = couponCode;
5263
    }
5264
 
5265
    public void unsetCouponCode() {
5266
      this.couponCode = null;
5267
    }
5268
 
3430 rajveer 5269
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 5270
    public boolean isSetCouponCode() {
5271
      return this.couponCode != null;
5272
    }
5273
 
5274
    public void setCouponCodeIsSet(boolean value) {
5275
      if (!value) {
5276
        this.couponCode = null;
5277
      }
5278
    }
5279
 
5280
    public void setFieldValue(_Fields field, Object value) {
5281
      switch (field) {
5282
      case PROMOTION_ID:
5283
        if (value == null) {
5284
          unsetPromotionId();
5285
        } else {
5286
          setPromotionId((Long)value);
5287
        }
5288
        break;
5289
 
5290
      case COUPON_CODE:
5291
        if (value == null) {
5292
          unsetCouponCode();
5293
        } else {
5294
          setCouponCode((String)value);
5295
        }
5296
        break;
5297
 
5298
      }
5299
    }
5300
 
5301
    public Object getFieldValue(_Fields field) {
5302
      switch (field) {
5303
      case PROMOTION_ID:
3430 rajveer 5304
        return Long.valueOf(getPromotionId());
1982 varun.gupt 5305
 
5306
      case COUPON_CODE:
5307
        return getCouponCode();
5308
 
5309
      }
5310
      throw new IllegalStateException();
5311
    }
5312
 
3430 rajveer 5313
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
5314
    public boolean isSet(_Fields field) {
5315
      if (field == null) {
5316
        throw new IllegalArgumentException();
5317
      }
1982 varun.gupt 5318
 
5319
      switch (field) {
5320
      case PROMOTION_ID:
5321
        return isSetPromotionId();
5322
      case COUPON_CODE:
5323
        return isSetCouponCode();
5324
      }
5325
      throw new IllegalStateException();
5326
    }
5327
 
5328
    @Override
5329
    public boolean equals(Object that) {
5330
      if (that == null)
5331
        return false;
5332
      if (that instanceof generateCouponsForPromotion_args)
5333
        return this.equals((generateCouponsForPromotion_args)that);
5334
      return false;
5335
    }
5336
 
5337
    public boolean equals(generateCouponsForPromotion_args that) {
5338
      if (that == null)
5339
        return false;
5340
 
5341
      boolean this_present_promotionId = true;
5342
      boolean that_present_promotionId = true;
5343
      if (this_present_promotionId || that_present_promotionId) {
5344
        if (!(this_present_promotionId && that_present_promotionId))
5345
          return false;
5346
        if (this.promotionId != that.promotionId)
5347
          return false;
5348
      }
5349
 
5350
      boolean this_present_couponCode = true && this.isSetCouponCode();
5351
      boolean that_present_couponCode = true && that.isSetCouponCode();
5352
      if (this_present_couponCode || that_present_couponCode) {
5353
        if (!(this_present_couponCode && that_present_couponCode))
5354
          return false;
5355
        if (!this.couponCode.equals(that.couponCode))
5356
          return false;
5357
      }
5358
 
5359
      return true;
5360
    }
5361
 
5362
    @Override
5363
    public int hashCode() {
5364
      return 0;
5365
    }
5366
 
5367
    public int compareTo(generateCouponsForPromotion_args other) {
5368
      if (!getClass().equals(other.getClass())) {
5369
        return getClass().getName().compareTo(other.getClass().getName());
5370
      }
5371
 
5372
      int lastComparison = 0;
5373
      generateCouponsForPromotion_args typedOther = (generateCouponsForPromotion_args)other;
5374
 
3430 rajveer 5375
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
1982 varun.gupt 5376
      if (lastComparison != 0) {
5377
        return lastComparison;
5378
      }
3430 rajveer 5379
      if (isSetPromotionId()) {
5380
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
5381
        if (lastComparison != 0) {
5382
          return lastComparison;
5383
        }
1982 varun.gupt 5384
      }
3430 rajveer 5385
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 5386
      if (lastComparison != 0) {
5387
        return lastComparison;
5388
      }
3430 rajveer 5389
      if (isSetCouponCode()) {
5390
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
5391
        if (lastComparison != 0) {
5392
          return lastComparison;
5393
        }
1982 varun.gupt 5394
      }
5395
      return 0;
5396
    }
5397
 
3430 rajveer 5398
    public _Fields fieldForId(int fieldId) {
5399
      return _Fields.findByThriftId(fieldId);
5400
    }
5401
 
5402
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
5403
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 5404
      iprot.readStructBegin();
5405
      while (true)
5406
      {
5407
        field = iprot.readFieldBegin();
3430 rajveer 5408
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 5409
          break;
5410
        }
3430 rajveer 5411
        switch (field.id) {
5412
          case 1: // PROMOTION_ID
5413
            if (field.type == org.apache.thrift.protocol.TType.I64) {
5414
              this.promotionId = iprot.readI64();
5415
              setPromotionIdIsSet(true);
5416
            } else { 
5417
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5418
            }
5419
            break;
5420
          case 2: // COUPON_CODE
5421
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
5422
              this.couponCode = iprot.readString();
5423
            } else { 
5424
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5425
            }
5426
            break;
5427
          default:
5428
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 5429
        }
3430 rajveer 5430
        iprot.readFieldEnd();
1982 varun.gupt 5431
      }
5432
      iprot.readStructEnd();
5433
      validate();
5434
    }
5435
 
3430 rajveer 5436
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 5437
      validate();
5438
 
5439
      oprot.writeStructBegin(STRUCT_DESC);
5440
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
5441
      oprot.writeI64(this.promotionId);
5442
      oprot.writeFieldEnd();
5443
      if (this.couponCode != null) {
5444
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
5445
        oprot.writeString(this.couponCode);
5446
        oprot.writeFieldEnd();
5447
      }
5448
      oprot.writeFieldStop();
5449
      oprot.writeStructEnd();
5450
    }
5451
 
5452
    @Override
5453
    public String toString() {
5454
      StringBuilder sb = new StringBuilder("generateCouponsForPromotion_args(");
5455
      boolean first = true;
5456
 
5457
      sb.append("promotionId:");
5458
      sb.append(this.promotionId);
5459
      first = false;
5460
      if (!first) sb.append(", ");
5461
      sb.append("couponCode:");
5462
      if (this.couponCode == null) {
5463
        sb.append("null");
5464
      } else {
5465
        sb.append(this.couponCode);
5466
      }
5467
      first = false;
5468
      sb.append(")");
5469
      return sb.toString();
5470
    }
5471
 
3430 rajveer 5472
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 5473
      // check for required fields
5474
    }
5475
 
3430 rajveer 5476
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5477
      try {
5478
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5479
      } catch (org.apache.thrift.TException te) {
5480
        throw new java.io.IOException(te);
5481
      }
5482
    }
5483
 
5484
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5485
      try {
5486
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
5487
        __isset_bit_vector = new BitSet(1);
5488
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5489
      } catch (org.apache.thrift.TException te) {
5490
        throw new java.io.IOException(te);
5491
      }
5492
    }
5493
 
1982 varun.gupt 5494
  }
5495
 
3430 rajveer 5496
  public static class generateCouponsForPromotion_result implements org.apache.thrift.TBase<generateCouponsForPromotion_result, generateCouponsForPromotion_result._Fields>, java.io.Serializable, Cloneable   {
5497
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("generateCouponsForPromotion_result");
1982 varun.gupt 5498
 
3430 rajveer 5499
    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 5500
 
3430 rajveer 5501
    private PromotionException pex; // required
1982 varun.gupt 5502
 
5503
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 5504
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 5505
      PEX((short)1, "pex");
5506
 
5507
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5508
 
5509
      static {
5510
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5511
          byName.put(field.getFieldName(), field);
5512
        }
5513
      }
5514
 
5515
      /**
5516
       * Find the _Fields constant that matches fieldId, or null if its not found.
5517
       */
5518
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 5519
        switch(fieldId) {
5520
          case 1: // PEX
5521
            return PEX;
5522
          default:
5523
            return null;
5524
        }
1982 varun.gupt 5525
      }
5526
 
5527
      /**
5528
       * Find the _Fields constant that matches fieldId, throwing an exception
5529
       * if it is not found.
5530
       */
5531
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5532
        _Fields fields = findByThriftId(fieldId);
5533
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5534
        return fields;
5535
      }
5536
 
5537
      /**
5538
       * Find the _Fields constant that matches name, or null if its not found.
5539
       */
5540
      public static _Fields findByName(String name) {
5541
        return byName.get(name);
5542
      }
5543
 
5544
      private final short _thriftId;
5545
      private final String _fieldName;
5546
 
5547
      _Fields(short thriftId, String fieldName) {
5548
        _thriftId = thriftId;
5549
        _fieldName = fieldName;
5550
      }
5551
 
5552
      public short getThriftFieldId() {
5553
        return _thriftId;
5554
      }
5555
 
5556
      public String getFieldName() {
5557
        return _fieldName;
5558
      }
5559
    }
5560
 
5561
    // isset id assignments
5562
 
3430 rajveer 5563
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 5564
    static {
3430 rajveer 5565
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
5566
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5567
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
5568
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5569
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(generateCouponsForPromotion_result.class, metaDataMap);
1982 varun.gupt 5570
    }
5571
 
5572
    public generateCouponsForPromotion_result() {
5573
    }
5574
 
5575
    public generateCouponsForPromotion_result(
5576
      PromotionException pex)
5577
    {
5578
      this();
5579
      this.pex = pex;
5580
    }
5581
 
5582
    /**
5583
     * Performs a deep copy on <i>other</i>.
5584
     */
5585
    public generateCouponsForPromotion_result(generateCouponsForPromotion_result other) {
5586
      if (other.isSetPex()) {
5587
        this.pex = new PromotionException(other.pex);
5588
      }
5589
    }
5590
 
5591
    public generateCouponsForPromotion_result deepCopy() {
5592
      return new generateCouponsForPromotion_result(this);
5593
    }
5594
 
3430 rajveer 5595
    @Override
5596
    public void clear() {
5597
      this.pex = null;
1982 varun.gupt 5598
    }
5599
 
5600
    public PromotionException getPex() {
5601
      return this.pex;
5602
    }
5603
 
3430 rajveer 5604
    public void setPex(PromotionException pex) {
1982 varun.gupt 5605
      this.pex = pex;
5606
    }
5607
 
5608
    public void unsetPex() {
5609
      this.pex = null;
5610
    }
5611
 
3430 rajveer 5612
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 5613
    public boolean isSetPex() {
5614
      return this.pex != null;
5615
    }
5616
 
5617
    public void setPexIsSet(boolean value) {
5618
      if (!value) {
5619
        this.pex = null;
5620
      }
5621
    }
5622
 
5623
    public void setFieldValue(_Fields field, Object value) {
5624
      switch (field) {
5625
      case PEX:
5626
        if (value == null) {
5627
          unsetPex();
5628
        } else {
5629
          setPex((PromotionException)value);
5630
        }
5631
        break;
5632
 
5633
      }
5634
    }
5635
 
5636
    public Object getFieldValue(_Fields field) {
5637
      switch (field) {
5638
      case PEX:
5639
        return getPex();
5640
 
5641
      }
5642
      throw new IllegalStateException();
5643
    }
5644
 
3430 rajveer 5645
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
5646
    public boolean isSet(_Fields field) {
5647
      if (field == null) {
5648
        throw new IllegalArgumentException();
5649
      }
1982 varun.gupt 5650
 
5651
      switch (field) {
5652
      case PEX:
5653
        return isSetPex();
5654
      }
5655
      throw new IllegalStateException();
5656
    }
5657
 
5658
    @Override
5659
    public boolean equals(Object that) {
5660
      if (that == null)
5661
        return false;
5662
      if (that instanceof generateCouponsForPromotion_result)
5663
        return this.equals((generateCouponsForPromotion_result)that);
5664
      return false;
5665
    }
5666
 
5667
    public boolean equals(generateCouponsForPromotion_result that) {
5668
      if (that == null)
5669
        return false;
5670
 
5671
      boolean this_present_pex = true && this.isSetPex();
5672
      boolean that_present_pex = true && that.isSetPex();
5673
      if (this_present_pex || that_present_pex) {
5674
        if (!(this_present_pex && that_present_pex))
5675
          return false;
5676
        if (!this.pex.equals(that.pex))
5677
          return false;
5678
      }
5679
 
5680
      return true;
5681
    }
5682
 
5683
    @Override
5684
    public int hashCode() {
5685
      return 0;
5686
    }
5687
 
5688
    public int compareTo(generateCouponsForPromotion_result other) {
5689
      if (!getClass().equals(other.getClass())) {
5690
        return getClass().getName().compareTo(other.getClass().getName());
5691
      }
5692
 
5693
      int lastComparison = 0;
5694
      generateCouponsForPromotion_result typedOther = (generateCouponsForPromotion_result)other;
5695
 
3430 rajveer 5696
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 5697
      if (lastComparison != 0) {
5698
        return lastComparison;
5699
      }
3430 rajveer 5700
      if (isSetPex()) {
5701
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
5702
        if (lastComparison != 0) {
5703
          return lastComparison;
5704
        }
1982 varun.gupt 5705
      }
5706
      return 0;
5707
    }
5708
 
3430 rajveer 5709
    public _Fields fieldForId(int fieldId) {
5710
      return _Fields.findByThriftId(fieldId);
5711
    }
5712
 
5713
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
5714
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 5715
      iprot.readStructBegin();
5716
      while (true)
5717
      {
5718
        field = iprot.readFieldBegin();
3430 rajveer 5719
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 5720
          break;
5721
        }
3430 rajveer 5722
        switch (field.id) {
5723
          case 1: // PEX
5724
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
5725
              this.pex = new PromotionException();
5726
              this.pex.read(iprot);
5727
            } else { 
5728
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5729
            }
5730
            break;
5731
          default:
5732
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 5733
        }
3430 rajveer 5734
        iprot.readFieldEnd();
1982 varun.gupt 5735
      }
5736
      iprot.readStructEnd();
5737
      validate();
5738
    }
5739
 
3430 rajveer 5740
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 5741
      oprot.writeStructBegin(STRUCT_DESC);
5742
 
5743
      if (this.isSetPex()) {
5744
        oprot.writeFieldBegin(PEX_FIELD_DESC);
5745
        this.pex.write(oprot);
5746
        oprot.writeFieldEnd();
5747
      }
5748
      oprot.writeFieldStop();
5749
      oprot.writeStructEnd();
5750
    }
5751
 
5752
    @Override
5753
    public String toString() {
5754
      StringBuilder sb = new StringBuilder("generateCouponsForPromotion_result(");
5755
      boolean first = true;
5756
 
5757
      sb.append("pex:");
5758
      if (this.pex == null) {
5759
        sb.append("null");
5760
      } else {
5761
        sb.append(this.pex);
5762
      }
5763
      first = false;
5764
      sb.append(")");
5765
      return sb.toString();
5766
    }
5767
 
3430 rajveer 5768
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 5769
      // check for required fields
5770
    }
5771
 
3430 rajveer 5772
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5773
      try {
5774
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5775
      } catch (org.apache.thrift.TException te) {
5776
        throw new java.io.IOException(te);
5777
      }
5778
    }
5779
 
5780
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5781
      try {
5782
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5783
      } catch (org.apache.thrift.TException te) {
5784
        throw new java.io.IOException(te);
5785
      }
5786
    }
5787
 
1982 varun.gupt 5788
  }
5789
 
3430 rajveer 5790
  public static class applyCoupon_args implements org.apache.thrift.TBase<applyCoupon_args, applyCoupon_args._Fields>, java.io.Serializable, Cloneable   {
5791
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyCoupon_args");
1982 varun.gupt 5792
 
3430 rajveer 5793
    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);
5794
    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 5795
 
3430 rajveer 5796
    private String couponCode; // required
5797
    private long cartId; // required
1982 varun.gupt 5798
 
5799
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 5800
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 5801
      COUPON_CODE((short)1, "couponCode"),
5802
      CART_ID((short)2, "cartId");
5803
 
5804
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5805
 
5806
      static {
5807
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5808
          byName.put(field.getFieldName(), field);
5809
        }
5810
      }
5811
 
5812
      /**
5813
       * Find the _Fields constant that matches fieldId, or null if its not found.
5814
       */
5815
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 5816
        switch(fieldId) {
5817
          case 1: // COUPON_CODE
5818
            return COUPON_CODE;
5819
          case 2: // CART_ID
5820
            return CART_ID;
5821
          default:
5822
            return null;
5823
        }
1982 varun.gupt 5824
      }
5825
 
5826
      /**
5827
       * Find the _Fields constant that matches fieldId, throwing an exception
5828
       * if it is not found.
5829
       */
5830
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5831
        _Fields fields = findByThriftId(fieldId);
5832
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5833
        return fields;
5834
      }
5835
 
5836
      /**
5837
       * Find the _Fields constant that matches name, or null if its not found.
5838
       */
5839
      public static _Fields findByName(String name) {
5840
        return byName.get(name);
5841
      }
5842
 
5843
      private final short _thriftId;
5844
      private final String _fieldName;
5845
 
5846
      _Fields(short thriftId, String fieldName) {
5847
        _thriftId = thriftId;
5848
        _fieldName = fieldName;
5849
      }
5850
 
5851
      public short getThriftFieldId() {
5852
        return _thriftId;
5853
      }
5854
 
5855
      public String getFieldName() {
5856
        return _fieldName;
5857
      }
5858
    }
5859
 
5860
    // isset id assignments
5861
    private static final int __CARTID_ISSET_ID = 0;
5862
    private BitSet __isset_bit_vector = new BitSet(1);
5863
 
3430 rajveer 5864
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 5865
    static {
3430 rajveer 5866
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
5867
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5868
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
5869
      tmpMap.put(_Fields.CART_ID, new org.apache.thrift.meta_data.FieldMetaData("cartId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5870
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
5871
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5872
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyCoupon_args.class, metaDataMap);
1982 varun.gupt 5873
    }
5874
 
5875
    public applyCoupon_args() {
5876
    }
5877
 
5878
    public applyCoupon_args(
5879
      String couponCode,
5880
      long cartId)
5881
    {
5882
      this();
5883
      this.couponCode = couponCode;
5884
      this.cartId = cartId;
5885
      setCartIdIsSet(true);
5886
    }
5887
 
5888
    /**
5889
     * Performs a deep copy on <i>other</i>.
5890
     */
5891
    public applyCoupon_args(applyCoupon_args other) {
5892
      __isset_bit_vector.clear();
5893
      __isset_bit_vector.or(other.__isset_bit_vector);
5894
      if (other.isSetCouponCode()) {
5895
        this.couponCode = other.couponCode;
5896
      }
5897
      this.cartId = other.cartId;
5898
    }
5899
 
5900
    public applyCoupon_args deepCopy() {
5901
      return new applyCoupon_args(this);
5902
    }
5903
 
3430 rajveer 5904
    @Override
5905
    public void clear() {
5906
      this.couponCode = null;
5907
      setCartIdIsSet(false);
5908
      this.cartId = 0;
1982 varun.gupt 5909
    }
5910
 
5911
    public String getCouponCode() {
5912
      return this.couponCode;
5913
    }
5914
 
3430 rajveer 5915
    public void setCouponCode(String couponCode) {
1982 varun.gupt 5916
      this.couponCode = couponCode;
5917
    }
5918
 
5919
    public void unsetCouponCode() {
5920
      this.couponCode = null;
5921
    }
5922
 
3430 rajveer 5923
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 5924
    public boolean isSetCouponCode() {
5925
      return this.couponCode != null;
5926
    }
5927
 
5928
    public void setCouponCodeIsSet(boolean value) {
5929
      if (!value) {
5930
        this.couponCode = null;
5931
      }
5932
    }
5933
 
5934
    public long getCartId() {
5935
      return this.cartId;
5936
    }
5937
 
3430 rajveer 5938
    public void setCartId(long cartId) {
1982 varun.gupt 5939
      this.cartId = cartId;
5940
      setCartIdIsSet(true);
5941
    }
5942
 
5943
    public void unsetCartId() {
5944
      __isset_bit_vector.clear(__CARTID_ISSET_ID);
5945
    }
5946
 
3430 rajveer 5947
    /** Returns true if field cartId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 5948
    public boolean isSetCartId() {
5949
      return __isset_bit_vector.get(__CARTID_ISSET_ID);
5950
    }
5951
 
5952
    public void setCartIdIsSet(boolean value) {
5953
      __isset_bit_vector.set(__CARTID_ISSET_ID, value);
5954
    }
5955
 
5956
    public void setFieldValue(_Fields field, Object value) {
5957
      switch (field) {
5958
      case COUPON_CODE:
5959
        if (value == null) {
5960
          unsetCouponCode();
5961
        } else {
5962
          setCouponCode((String)value);
5963
        }
5964
        break;
5965
 
5966
      case CART_ID:
5967
        if (value == null) {
5968
          unsetCartId();
5969
        } else {
5970
          setCartId((Long)value);
5971
        }
5972
        break;
5973
 
5974
      }
5975
    }
5976
 
5977
    public Object getFieldValue(_Fields field) {
5978
      switch (field) {
5979
      case COUPON_CODE:
5980
        return getCouponCode();
5981
 
5982
      case CART_ID:
3430 rajveer 5983
        return Long.valueOf(getCartId());
1982 varun.gupt 5984
 
5985
      }
5986
      throw new IllegalStateException();
5987
    }
5988
 
3430 rajveer 5989
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
5990
    public boolean isSet(_Fields field) {
5991
      if (field == null) {
5992
        throw new IllegalArgumentException();
5993
      }
1982 varun.gupt 5994
 
5995
      switch (field) {
5996
      case COUPON_CODE:
5997
        return isSetCouponCode();
5998
      case CART_ID:
5999
        return isSetCartId();
6000
      }
6001
      throw new IllegalStateException();
6002
    }
6003
 
6004
    @Override
6005
    public boolean equals(Object that) {
6006
      if (that == null)
6007
        return false;
6008
      if (that instanceof applyCoupon_args)
6009
        return this.equals((applyCoupon_args)that);
6010
      return false;
6011
    }
6012
 
6013
    public boolean equals(applyCoupon_args that) {
6014
      if (that == null)
6015
        return false;
6016
 
6017
      boolean this_present_couponCode = true && this.isSetCouponCode();
6018
      boolean that_present_couponCode = true && that.isSetCouponCode();
6019
      if (this_present_couponCode || that_present_couponCode) {
6020
        if (!(this_present_couponCode && that_present_couponCode))
6021
          return false;
6022
        if (!this.couponCode.equals(that.couponCode))
6023
          return false;
6024
      }
6025
 
6026
      boolean this_present_cartId = true;
6027
      boolean that_present_cartId = true;
6028
      if (this_present_cartId || that_present_cartId) {
6029
        if (!(this_present_cartId && that_present_cartId))
6030
          return false;
6031
        if (this.cartId != that.cartId)
6032
          return false;
6033
      }
6034
 
6035
      return true;
6036
    }
6037
 
6038
    @Override
6039
    public int hashCode() {
6040
      return 0;
6041
    }
6042
 
6043
    public int compareTo(applyCoupon_args other) {
6044
      if (!getClass().equals(other.getClass())) {
6045
        return getClass().getName().compareTo(other.getClass().getName());
6046
      }
6047
 
6048
      int lastComparison = 0;
6049
      applyCoupon_args typedOther = (applyCoupon_args)other;
6050
 
3430 rajveer 6051
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 6052
      if (lastComparison != 0) {
6053
        return lastComparison;
6054
      }
3430 rajveer 6055
      if (isSetCouponCode()) {
6056
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
6057
        if (lastComparison != 0) {
6058
          return lastComparison;
6059
        }
1982 varun.gupt 6060
      }
3430 rajveer 6061
      lastComparison = Boolean.valueOf(isSetCartId()).compareTo(typedOther.isSetCartId());
1982 varun.gupt 6062
      if (lastComparison != 0) {
6063
        return lastComparison;
6064
      }
3430 rajveer 6065
      if (isSetCartId()) {
6066
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cartId, typedOther.cartId);
6067
        if (lastComparison != 0) {
6068
          return lastComparison;
6069
        }
1982 varun.gupt 6070
      }
6071
      return 0;
6072
    }
6073
 
3430 rajveer 6074
    public _Fields fieldForId(int fieldId) {
6075
      return _Fields.findByThriftId(fieldId);
6076
    }
6077
 
6078
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
6079
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 6080
      iprot.readStructBegin();
6081
      while (true)
6082
      {
6083
        field = iprot.readFieldBegin();
3430 rajveer 6084
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 6085
          break;
6086
        }
3430 rajveer 6087
        switch (field.id) {
6088
          case 1: // COUPON_CODE
6089
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
6090
              this.couponCode = iprot.readString();
6091
            } else { 
6092
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6093
            }
6094
            break;
6095
          case 2: // CART_ID
6096
            if (field.type == org.apache.thrift.protocol.TType.I64) {
6097
              this.cartId = iprot.readI64();
6098
              setCartIdIsSet(true);
6099
            } else { 
6100
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6101
            }
6102
            break;
6103
          default:
6104
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 6105
        }
3430 rajveer 6106
        iprot.readFieldEnd();
1982 varun.gupt 6107
      }
6108
      iprot.readStructEnd();
6109
      validate();
6110
    }
6111
 
3430 rajveer 6112
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 6113
      validate();
6114
 
6115
      oprot.writeStructBegin(STRUCT_DESC);
6116
      if (this.couponCode != null) {
6117
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
6118
        oprot.writeString(this.couponCode);
6119
        oprot.writeFieldEnd();
6120
      }
6121
      oprot.writeFieldBegin(CART_ID_FIELD_DESC);
6122
      oprot.writeI64(this.cartId);
6123
      oprot.writeFieldEnd();
6124
      oprot.writeFieldStop();
6125
      oprot.writeStructEnd();
6126
    }
6127
 
6128
    @Override
6129
    public String toString() {
6130
      StringBuilder sb = new StringBuilder("applyCoupon_args(");
6131
      boolean first = true;
6132
 
6133
      sb.append("couponCode:");
6134
      if (this.couponCode == null) {
6135
        sb.append("null");
6136
      } else {
6137
        sb.append(this.couponCode);
6138
      }
6139
      first = false;
6140
      if (!first) sb.append(", ");
6141
      sb.append("cartId:");
6142
      sb.append(this.cartId);
6143
      first = false;
6144
      sb.append(")");
6145
      return sb.toString();
6146
    }
6147
 
3430 rajveer 6148
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 6149
      // check for required fields
6150
    }
6151
 
3430 rajveer 6152
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
6153
      try {
6154
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
6155
      } catch (org.apache.thrift.TException te) {
6156
        throw new java.io.IOException(te);
6157
      }
6158
    }
6159
 
6160
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
6161
      try {
6162
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
6163
        __isset_bit_vector = new BitSet(1);
6164
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
6165
      } catch (org.apache.thrift.TException te) {
6166
        throw new java.io.IOException(te);
6167
      }
6168
    }
6169
 
1982 varun.gupt 6170
  }
6171
 
3430 rajveer 6172
  public static class applyCoupon_result implements org.apache.thrift.TBase<applyCoupon_result, applyCoupon_result._Fields>, java.io.Serializable, Cloneable   {
6173
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyCoupon_result");
1982 varun.gupt 6174
 
3430 rajveer 6175
    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);
6176
    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 6177
 
3430 rajveer 6178
    private Cart success; // required
6179
    private PromotionException pex; // required
1982 varun.gupt 6180
 
6181
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 6182
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 6183
      SUCCESS((short)0, "success"),
6184
      PEX((short)1, "pex");
6185
 
6186
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6187
 
6188
      static {
6189
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6190
          byName.put(field.getFieldName(), field);
6191
        }
6192
      }
6193
 
6194
      /**
6195
       * Find the _Fields constant that matches fieldId, or null if its not found.
6196
       */
6197
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 6198
        switch(fieldId) {
6199
          case 0: // SUCCESS
6200
            return SUCCESS;
6201
          case 1: // PEX
6202
            return PEX;
6203
          default:
6204
            return null;
6205
        }
1982 varun.gupt 6206
      }
6207
 
6208
      /**
6209
       * Find the _Fields constant that matches fieldId, throwing an exception
6210
       * if it is not found.
6211
       */
6212
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6213
        _Fields fields = findByThriftId(fieldId);
6214
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6215
        return fields;
6216
      }
6217
 
6218
      /**
6219
       * Find the _Fields constant that matches name, or null if its not found.
6220
       */
6221
      public static _Fields findByName(String name) {
6222
        return byName.get(name);
6223
      }
6224
 
6225
      private final short _thriftId;
6226
      private final String _fieldName;
6227
 
6228
      _Fields(short thriftId, String fieldName) {
6229
        _thriftId = thriftId;
6230
        _fieldName = fieldName;
6231
      }
6232
 
6233
      public short getThriftFieldId() {
6234
        return _thriftId;
6235
      }
6236
 
6237
      public String getFieldName() {
6238
        return _fieldName;
6239
      }
6240
    }
6241
 
6242
    // isset id assignments
6243
 
3430 rajveer 6244
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 6245
    static {
3430 rajveer 6246
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
6247
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6248
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Cart.class)));
6249
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6250
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
6251
      metaDataMap = Collections.unmodifiableMap(tmpMap);
6252
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyCoupon_result.class, metaDataMap);
1982 varun.gupt 6253
    }
6254
 
6255
    public applyCoupon_result() {
6256
    }
6257
 
6258
    public applyCoupon_result(
6259
      Cart success,
6260
      PromotionException pex)
6261
    {
6262
      this();
6263
      this.success = success;
6264
      this.pex = pex;
6265
    }
6266
 
6267
    /**
6268
     * Performs a deep copy on <i>other</i>.
6269
     */
6270
    public applyCoupon_result(applyCoupon_result other) {
6271
      if (other.isSetSuccess()) {
6272
        this.success = new Cart(other.success);
6273
      }
6274
      if (other.isSetPex()) {
6275
        this.pex = new PromotionException(other.pex);
6276
      }
6277
    }
6278
 
6279
    public applyCoupon_result deepCopy() {
6280
      return new applyCoupon_result(this);
6281
    }
6282
 
3430 rajveer 6283
    @Override
6284
    public void clear() {
6285
      this.success = null;
6286
      this.pex = null;
1982 varun.gupt 6287
    }
6288
 
6289
    public Cart getSuccess() {
6290
      return this.success;
6291
    }
6292
 
3430 rajveer 6293
    public void setSuccess(Cart success) {
1982 varun.gupt 6294
      this.success = success;
6295
    }
6296
 
6297
    public void unsetSuccess() {
6298
      this.success = null;
6299
    }
6300
 
3430 rajveer 6301
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6302
    public boolean isSetSuccess() {
6303
      return this.success != null;
6304
    }
6305
 
6306
    public void setSuccessIsSet(boolean value) {
6307
      if (!value) {
6308
        this.success = null;
6309
      }
6310
    }
6311
 
6312
    public PromotionException getPex() {
6313
      return this.pex;
6314
    }
6315
 
3430 rajveer 6316
    public void setPex(PromotionException pex) {
1982 varun.gupt 6317
      this.pex = pex;
6318
    }
6319
 
6320
    public void unsetPex() {
6321
      this.pex = null;
6322
    }
6323
 
3430 rajveer 6324
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6325
    public boolean isSetPex() {
6326
      return this.pex != null;
6327
    }
6328
 
6329
    public void setPexIsSet(boolean value) {
6330
      if (!value) {
6331
        this.pex = null;
6332
      }
6333
    }
6334
 
6335
    public void setFieldValue(_Fields field, Object value) {
6336
      switch (field) {
6337
      case SUCCESS:
6338
        if (value == null) {
6339
          unsetSuccess();
6340
        } else {
6341
          setSuccess((Cart)value);
6342
        }
6343
        break;
6344
 
6345
      case PEX:
6346
        if (value == null) {
6347
          unsetPex();
6348
        } else {
6349
          setPex((PromotionException)value);
6350
        }
6351
        break;
6352
 
6353
      }
6354
    }
6355
 
6356
    public Object getFieldValue(_Fields field) {
6357
      switch (field) {
6358
      case SUCCESS:
6359
        return getSuccess();
6360
 
6361
      case PEX:
6362
        return getPex();
6363
 
6364
      }
6365
      throw new IllegalStateException();
6366
    }
6367
 
3430 rajveer 6368
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
6369
    public boolean isSet(_Fields field) {
6370
      if (field == null) {
6371
        throw new IllegalArgumentException();
6372
      }
1982 varun.gupt 6373
 
6374
      switch (field) {
6375
      case SUCCESS:
6376
        return isSetSuccess();
6377
      case PEX:
6378
        return isSetPex();
6379
      }
6380
      throw new IllegalStateException();
6381
    }
6382
 
6383
    @Override
6384
    public boolean equals(Object that) {
6385
      if (that == null)
6386
        return false;
6387
      if (that instanceof applyCoupon_result)
6388
        return this.equals((applyCoupon_result)that);
6389
      return false;
6390
    }
6391
 
6392
    public boolean equals(applyCoupon_result that) {
6393
      if (that == null)
6394
        return false;
6395
 
6396
      boolean this_present_success = true && this.isSetSuccess();
6397
      boolean that_present_success = true && that.isSetSuccess();
6398
      if (this_present_success || that_present_success) {
6399
        if (!(this_present_success && that_present_success))
6400
          return false;
6401
        if (!this.success.equals(that.success))
6402
          return false;
6403
      }
6404
 
6405
      boolean this_present_pex = true && this.isSetPex();
6406
      boolean that_present_pex = true && that.isSetPex();
6407
      if (this_present_pex || that_present_pex) {
6408
        if (!(this_present_pex && that_present_pex))
6409
          return false;
6410
        if (!this.pex.equals(that.pex))
6411
          return false;
6412
      }
6413
 
6414
      return true;
6415
    }
6416
 
6417
    @Override
6418
    public int hashCode() {
6419
      return 0;
6420
    }
6421
 
6422
    public int compareTo(applyCoupon_result other) {
6423
      if (!getClass().equals(other.getClass())) {
6424
        return getClass().getName().compareTo(other.getClass().getName());
6425
      }
6426
 
6427
      int lastComparison = 0;
6428
      applyCoupon_result typedOther = (applyCoupon_result)other;
6429
 
3430 rajveer 6430
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 6431
      if (lastComparison != 0) {
6432
        return lastComparison;
6433
      }
3430 rajveer 6434
      if (isSetSuccess()) {
6435
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
6436
        if (lastComparison != 0) {
6437
          return lastComparison;
6438
        }
1982 varun.gupt 6439
      }
3430 rajveer 6440
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 6441
      if (lastComparison != 0) {
6442
        return lastComparison;
6443
      }
3430 rajveer 6444
      if (isSetPex()) {
6445
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
6446
        if (lastComparison != 0) {
6447
          return lastComparison;
6448
        }
1982 varun.gupt 6449
      }
6450
      return 0;
6451
    }
6452
 
3430 rajveer 6453
    public _Fields fieldForId(int fieldId) {
6454
      return _Fields.findByThriftId(fieldId);
6455
    }
6456
 
6457
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
6458
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 6459
      iprot.readStructBegin();
6460
      while (true)
6461
      {
6462
        field = iprot.readFieldBegin();
3430 rajveer 6463
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 6464
          break;
6465
        }
3430 rajveer 6466
        switch (field.id) {
6467
          case 0: // SUCCESS
6468
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
6469
              this.success = new Cart();
6470
              this.success.read(iprot);
6471
            } else { 
6472
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6473
            }
6474
            break;
6475
          case 1: // PEX
6476
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
6477
              this.pex = new PromotionException();
6478
              this.pex.read(iprot);
6479
            } else { 
6480
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6481
            }
6482
            break;
6483
          default:
6484
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 6485
        }
3430 rajveer 6486
        iprot.readFieldEnd();
1982 varun.gupt 6487
      }
6488
      iprot.readStructEnd();
6489
      validate();
6490
    }
6491
 
3430 rajveer 6492
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 6493
      oprot.writeStructBegin(STRUCT_DESC);
6494
 
6495
      if (this.isSetSuccess()) {
6496
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
6497
        this.success.write(oprot);
6498
        oprot.writeFieldEnd();
6499
      } else if (this.isSetPex()) {
6500
        oprot.writeFieldBegin(PEX_FIELD_DESC);
6501
        this.pex.write(oprot);
6502
        oprot.writeFieldEnd();
6503
      }
6504
      oprot.writeFieldStop();
6505
      oprot.writeStructEnd();
6506
    }
6507
 
6508
    @Override
6509
    public String toString() {
6510
      StringBuilder sb = new StringBuilder("applyCoupon_result(");
6511
      boolean first = true;
6512
 
6513
      sb.append("success:");
6514
      if (this.success == null) {
6515
        sb.append("null");
6516
      } else {
6517
        sb.append(this.success);
6518
      }
6519
      first = false;
6520
      if (!first) sb.append(", ");
6521
      sb.append("pex:");
6522
      if (this.pex == null) {
6523
        sb.append("null");
6524
      } else {
6525
        sb.append(this.pex);
6526
      }
6527
      first = false;
6528
      sb.append(")");
6529
      return sb.toString();
6530
    }
6531
 
3430 rajveer 6532
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 6533
      // check for required fields
6534
    }
6535
 
3430 rajveer 6536
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
6537
      try {
6538
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
6539
      } catch (org.apache.thrift.TException te) {
6540
        throw new java.io.IOException(te);
6541
      }
6542
    }
6543
 
6544
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
6545
      try {
6546
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
6547
      } catch (org.apache.thrift.TException te) {
6548
        throw new java.io.IOException(te);
6549
      }
6550
    }
6551
 
1982 varun.gupt 6552
  }
6553
 
3430 rajveer 6554
  public static class trackCouponUsage_args implements org.apache.thrift.TBase<trackCouponUsage_args, trackCouponUsage_args._Fields>, java.io.Serializable, Cloneable   {
6555
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("trackCouponUsage_args");
1982 varun.gupt 6556
 
3430 rajveer 6557
    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);
6558
    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);
6559
    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 6560
 
3430 rajveer 6561
    private String couponCode; // required
6562
    private long transactionId; // required
6563
    private long userId; // required
1982 varun.gupt 6564
 
6565
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 6566
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 6567
      COUPON_CODE((short)1, "couponCode"),
6568
      TRANSACTION_ID((short)2, "transactionId"),
6569
      USER_ID((short)3, "userId");
6570
 
6571
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6572
 
6573
      static {
6574
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6575
          byName.put(field.getFieldName(), field);
6576
        }
6577
      }
6578
 
6579
      /**
6580
       * Find the _Fields constant that matches fieldId, or null if its not found.
6581
       */
6582
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 6583
        switch(fieldId) {
6584
          case 1: // COUPON_CODE
6585
            return COUPON_CODE;
6586
          case 2: // TRANSACTION_ID
6587
            return TRANSACTION_ID;
6588
          case 3: // USER_ID
6589
            return USER_ID;
6590
          default:
6591
            return null;
6592
        }
1982 varun.gupt 6593
      }
6594
 
6595
      /**
6596
       * Find the _Fields constant that matches fieldId, throwing an exception
6597
       * if it is not found.
6598
       */
6599
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6600
        _Fields fields = findByThriftId(fieldId);
6601
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6602
        return fields;
6603
      }
6604
 
6605
      /**
6606
       * Find the _Fields constant that matches name, or null if its not found.
6607
       */
6608
      public static _Fields findByName(String name) {
6609
        return byName.get(name);
6610
      }
6611
 
6612
      private final short _thriftId;
6613
      private final String _fieldName;
6614
 
6615
      _Fields(short thriftId, String fieldName) {
6616
        _thriftId = thriftId;
6617
        _fieldName = fieldName;
6618
      }
6619
 
6620
      public short getThriftFieldId() {
6621
        return _thriftId;
6622
      }
6623
 
6624
      public String getFieldName() {
6625
        return _fieldName;
6626
      }
6627
    }
6628
 
6629
    // isset id assignments
6630
    private static final int __TRANSACTIONID_ISSET_ID = 0;
6631
    private static final int __USERID_ISSET_ID = 1;
6632
    private BitSet __isset_bit_vector = new BitSet(2);
6633
 
3430 rajveer 6634
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 6635
    static {
3430 rajveer 6636
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
6637
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6638
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
6639
      tmpMap.put(_Fields.TRANSACTION_ID, new org.apache.thrift.meta_data.FieldMetaData("transactionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6640
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
6641
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6642
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
6643
      metaDataMap = Collections.unmodifiableMap(tmpMap);
6644
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(trackCouponUsage_args.class, metaDataMap);
1982 varun.gupt 6645
    }
6646
 
6647
    public trackCouponUsage_args() {
6648
    }
6649
 
6650
    public trackCouponUsage_args(
6651
      String couponCode,
6652
      long transactionId,
6653
      long userId)
6654
    {
6655
      this();
6656
      this.couponCode = couponCode;
6657
      this.transactionId = transactionId;
6658
      setTransactionIdIsSet(true);
6659
      this.userId = userId;
6660
      setUserIdIsSet(true);
6661
    }
6662
 
6663
    /**
6664
     * Performs a deep copy on <i>other</i>.
6665
     */
6666
    public trackCouponUsage_args(trackCouponUsage_args other) {
6667
      __isset_bit_vector.clear();
6668
      __isset_bit_vector.or(other.__isset_bit_vector);
6669
      if (other.isSetCouponCode()) {
6670
        this.couponCode = other.couponCode;
6671
      }
6672
      this.transactionId = other.transactionId;
6673
      this.userId = other.userId;
6674
    }
6675
 
6676
    public trackCouponUsage_args deepCopy() {
6677
      return new trackCouponUsage_args(this);
6678
    }
6679
 
3430 rajveer 6680
    @Override
6681
    public void clear() {
6682
      this.couponCode = null;
6683
      setTransactionIdIsSet(false);
6684
      this.transactionId = 0;
6685
      setUserIdIsSet(false);
6686
      this.userId = 0;
1982 varun.gupt 6687
    }
6688
 
6689
    public String getCouponCode() {
6690
      return this.couponCode;
6691
    }
6692
 
3430 rajveer 6693
    public void setCouponCode(String couponCode) {
1982 varun.gupt 6694
      this.couponCode = couponCode;
6695
    }
6696
 
6697
    public void unsetCouponCode() {
6698
      this.couponCode = null;
6699
    }
6700
 
3430 rajveer 6701
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6702
    public boolean isSetCouponCode() {
6703
      return this.couponCode != null;
6704
    }
6705
 
6706
    public void setCouponCodeIsSet(boolean value) {
6707
      if (!value) {
6708
        this.couponCode = null;
6709
      }
6710
    }
6711
 
6712
    public long getTransactionId() {
6713
      return this.transactionId;
6714
    }
6715
 
3430 rajveer 6716
    public void setTransactionId(long transactionId) {
1982 varun.gupt 6717
      this.transactionId = transactionId;
6718
      setTransactionIdIsSet(true);
6719
    }
6720
 
6721
    public void unsetTransactionId() {
6722
      __isset_bit_vector.clear(__TRANSACTIONID_ISSET_ID);
6723
    }
6724
 
3430 rajveer 6725
    /** Returns true if field transactionId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6726
    public boolean isSetTransactionId() {
6727
      return __isset_bit_vector.get(__TRANSACTIONID_ISSET_ID);
6728
    }
6729
 
6730
    public void setTransactionIdIsSet(boolean value) {
6731
      __isset_bit_vector.set(__TRANSACTIONID_ISSET_ID, value);
6732
    }
6733
 
6734
    public long getUserId() {
6735
      return this.userId;
6736
    }
6737
 
3430 rajveer 6738
    public void setUserId(long userId) {
1982 varun.gupt 6739
      this.userId = userId;
6740
      setUserIdIsSet(true);
6741
    }
6742
 
6743
    public void unsetUserId() {
6744
      __isset_bit_vector.clear(__USERID_ISSET_ID);
6745
    }
6746
 
3430 rajveer 6747
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6748
    public boolean isSetUserId() {
6749
      return __isset_bit_vector.get(__USERID_ISSET_ID);
6750
    }
6751
 
6752
    public void setUserIdIsSet(boolean value) {
6753
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
6754
    }
6755
 
6756
    public void setFieldValue(_Fields field, Object value) {
6757
      switch (field) {
6758
      case COUPON_CODE:
6759
        if (value == null) {
6760
          unsetCouponCode();
6761
        } else {
6762
          setCouponCode((String)value);
6763
        }
6764
        break;
6765
 
6766
      case TRANSACTION_ID:
6767
        if (value == null) {
6768
          unsetTransactionId();
6769
        } else {
6770
          setTransactionId((Long)value);
6771
        }
6772
        break;
6773
 
6774
      case USER_ID:
6775
        if (value == null) {
6776
          unsetUserId();
6777
        } else {
6778
          setUserId((Long)value);
6779
        }
6780
        break;
6781
 
6782
      }
6783
    }
6784
 
6785
    public Object getFieldValue(_Fields field) {
6786
      switch (field) {
6787
      case COUPON_CODE:
6788
        return getCouponCode();
6789
 
6790
      case TRANSACTION_ID:
3430 rajveer 6791
        return Long.valueOf(getTransactionId());
1982 varun.gupt 6792
 
6793
      case USER_ID:
3430 rajveer 6794
        return Long.valueOf(getUserId());
1982 varun.gupt 6795
 
6796
      }
6797
      throw new IllegalStateException();
6798
    }
6799
 
3430 rajveer 6800
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
6801
    public boolean isSet(_Fields field) {
6802
      if (field == null) {
6803
        throw new IllegalArgumentException();
6804
      }
1982 varun.gupt 6805
 
6806
      switch (field) {
6807
      case COUPON_CODE:
6808
        return isSetCouponCode();
6809
      case TRANSACTION_ID:
6810
        return isSetTransactionId();
6811
      case USER_ID:
6812
        return isSetUserId();
6813
      }
6814
      throw new IllegalStateException();
6815
    }
6816
 
6817
    @Override
6818
    public boolean equals(Object that) {
6819
      if (that == null)
6820
        return false;
6821
      if (that instanceof trackCouponUsage_args)
6822
        return this.equals((trackCouponUsage_args)that);
6823
      return false;
6824
    }
6825
 
6826
    public boolean equals(trackCouponUsage_args that) {
6827
      if (that == null)
6828
        return false;
6829
 
6830
      boolean this_present_couponCode = true && this.isSetCouponCode();
6831
      boolean that_present_couponCode = true && that.isSetCouponCode();
6832
      if (this_present_couponCode || that_present_couponCode) {
6833
        if (!(this_present_couponCode && that_present_couponCode))
6834
          return false;
6835
        if (!this.couponCode.equals(that.couponCode))
6836
          return false;
6837
      }
6838
 
6839
      boolean this_present_transactionId = true;
6840
      boolean that_present_transactionId = true;
6841
      if (this_present_transactionId || that_present_transactionId) {
6842
        if (!(this_present_transactionId && that_present_transactionId))
6843
          return false;
6844
        if (this.transactionId != that.transactionId)
6845
          return false;
6846
      }
6847
 
6848
      boolean this_present_userId = true;
6849
      boolean that_present_userId = true;
6850
      if (this_present_userId || that_present_userId) {
6851
        if (!(this_present_userId && that_present_userId))
6852
          return false;
6853
        if (this.userId != that.userId)
6854
          return false;
6855
      }
6856
 
6857
      return true;
6858
    }
6859
 
6860
    @Override
6861
    public int hashCode() {
6862
      return 0;
6863
    }
6864
 
6865
    public int compareTo(trackCouponUsage_args other) {
6866
      if (!getClass().equals(other.getClass())) {
6867
        return getClass().getName().compareTo(other.getClass().getName());
6868
      }
6869
 
6870
      int lastComparison = 0;
6871
      trackCouponUsage_args typedOther = (trackCouponUsage_args)other;
6872
 
3430 rajveer 6873
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 6874
      if (lastComparison != 0) {
6875
        return lastComparison;
6876
      }
3430 rajveer 6877
      if (isSetCouponCode()) {
6878
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
6879
        if (lastComparison != 0) {
6880
          return lastComparison;
6881
        }
1982 varun.gupt 6882
      }
3430 rajveer 6883
      lastComparison = Boolean.valueOf(isSetTransactionId()).compareTo(typedOther.isSetTransactionId());
1982 varun.gupt 6884
      if (lastComparison != 0) {
6885
        return lastComparison;
6886
      }
3430 rajveer 6887
      if (isSetTransactionId()) {
6888
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.transactionId, typedOther.transactionId);
6889
        if (lastComparison != 0) {
6890
          return lastComparison;
6891
        }
1982 varun.gupt 6892
      }
3430 rajveer 6893
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
1982 varun.gupt 6894
      if (lastComparison != 0) {
6895
        return lastComparison;
6896
      }
3430 rajveer 6897
      if (isSetUserId()) {
6898
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
6899
        if (lastComparison != 0) {
6900
          return lastComparison;
6901
        }
1982 varun.gupt 6902
      }
6903
      return 0;
6904
    }
6905
 
3430 rajveer 6906
    public _Fields fieldForId(int fieldId) {
6907
      return _Fields.findByThriftId(fieldId);
6908
    }
6909
 
6910
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
6911
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 6912
      iprot.readStructBegin();
6913
      while (true)
6914
      {
6915
        field = iprot.readFieldBegin();
3430 rajveer 6916
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 6917
          break;
6918
        }
3430 rajveer 6919
        switch (field.id) {
6920
          case 1: // COUPON_CODE
6921
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
6922
              this.couponCode = iprot.readString();
6923
            } else { 
6924
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6925
            }
6926
            break;
6927
          case 2: // TRANSACTION_ID
6928
            if (field.type == org.apache.thrift.protocol.TType.I64) {
6929
              this.transactionId = iprot.readI64();
6930
              setTransactionIdIsSet(true);
6931
            } else { 
6932
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6933
            }
6934
            break;
6935
          case 3: // USER_ID
6936
            if (field.type == org.apache.thrift.protocol.TType.I64) {
6937
              this.userId = iprot.readI64();
6938
              setUserIdIsSet(true);
6939
            } else { 
6940
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6941
            }
6942
            break;
6943
          default:
6944
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 6945
        }
3430 rajveer 6946
        iprot.readFieldEnd();
1982 varun.gupt 6947
      }
6948
      iprot.readStructEnd();
6949
      validate();
6950
    }
6951
 
3430 rajveer 6952
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 6953
      validate();
6954
 
6955
      oprot.writeStructBegin(STRUCT_DESC);
6956
      if (this.couponCode != null) {
6957
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
6958
        oprot.writeString(this.couponCode);
6959
        oprot.writeFieldEnd();
6960
      }
6961
      oprot.writeFieldBegin(TRANSACTION_ID_FIELD_DESC);
6962
      oprot.writeI64(this.transactionId);
6963
      oprot.writeFieldEnd();
6964
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
6965
      oprot.writeI64(this.userId);
6966
      oprot.writeFieldEnd();
6967
      oprot.writeFieldStop();
6968
      oprot.writeStructEnd();
6969
    }
6970
 
6971
    @Override
6972
    public String toString() {
6973
      StringBuilder sb = new StringBuilder("trackCouponUsage_args(");
6974
      boolean first = true;
6975
 
6976
      sb.append("couponCode:");
6977
      if (this.couponCode == null) {
6978
        sb.append("null");
6979
      } else {
6980
        sb.append(this.couponCode);
6981
      }
6982
      first = false;
6983
      if (!first) sb.append(", ");
6984
      sb.append("transactionId:");
6985
      sb.append(this.transactionId);
6986
      first = false;
6987
      if (!first) sb.append(", ");
6988
      sb.append("userId:");
6989
      sb.append(this.userId);
6990
      first = false;
6991
      sb.append(")");
6992
      return sb.toString();
6993
    }
6994
 
3430 rajveer 6995
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 6996
      // check for required fields
6997
    }
6998
 
3430 rajveer 6999
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
7000
      try {
7001
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
7002
      } catch (org.apache.thrift.TException te) {
7003
        throw new java.io.IOException(te);
7004
      }
7005
    }
7006
 
7007
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
7008
      try {
7009
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
7010
        __isset_bit_vector = new BitSet(1);
7011
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
7012
      } catch (org.apache.thrift.TException te) {
7013
        throw new java.io.IOException(te);
7014
      }
7015
    }
7016
 
1982 varun.gupt 7017
  }
7018
 
3430 rajveer 7019
  public static class trackCouponUsage_result implements org.apache.thrift.TBase<trackCouponUsage_result, trackCouponUsage_result._Fields>, java.io.Serializable, Cloneable   {
7020
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("trackCouponUsage_result");
1982 varun.gupt 7021
 
3430 rajveer 7022
    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 7023
 
3430 rajveer 7024
    private PromotionException pex; // required
1982 varun.gupt 7025
 
7026
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 7027
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 7028
      PEX((short)1, "pex");
7029
 
7030
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7031
 
7032
      static {
7033
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7034
          byName.put(field.getFieldName(), field);
7035
        }
7036
      }
7037
 
7038
      /**
7039
       * Find the _Fields constant that matches fieldId, or null if its not found.
7040
       */
7041
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 7042
        switch(fieldId) {
7043
          case 1: // PEX
7044
            return PEX;
7045
          default:
7046
            return null;
7047
        }
1982 varun.gupt 7048
      }
7049
 
7050
      /**
7051
       * Find the _Fields constant that matches fieldId, throwing an exception
7052
       * if it is not found.
7053
       */
7054
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7055
        _Fields fields = findByThriftId(fieldId);
7056
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7057
        return fields;
7058
      }
7059
 
7060
      /**
7061
       * Find the _Fields constant that matches name, or null if its not found.
7062
       */
7063
      public static _Fields findByName(String name) {
7064
        return byName.get(name);
7065
      }
7066
 
7067
      private final short _thriftId;
7068
      private final String _fieldName;
7069
 
7070
      _Fields(short thriftId, String fieldName) {
7071
        _thriftId = thriftId;
7072
        _fieldName = fieldName;
7073
      }
7074
 
7075
      public short getThriftFieldId() {
7076
        return _thriftId;
7077
      }
7078
 
7079
      public String getFieldName() {
7080
        return _fieldName;
7081
      }
7082
    }
7083
 
7084
    // isset id assignments
7085
 
3430 rajveer 7086
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 7087
    static {
3430 rajveer 7088
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
7089
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7090
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
7091
      metaDataMap = Collections.unmodifiableMap(tmpMap);
7092
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(trackCouponUsage_result.class, metaDataMap);
1982 varun.gupt 7093
    }
7094
 
7095
    public trackCouponUsage_result() {
7096
    }
7097
 
7098
    public trackCouponUsage_result(
7099
      PromotionException pex)
7100
    {
7101
      this();
7102
      this.pex = pex;
7103
    }
7104
 
7105
    /**
7106
     * Performs a deep copy on <i>other</i>.
7107
     */
7108
    public trackCouponUsage_result(trackCouponUsage_result other) {
7109
      if (other.isSetPex()) {
7110
        this.pex = new PromotionException(other.pex);
7111
      }
7112
    }
7113
 
7114
    public trackCouponUsage_result deepCopy() {
7115
      return new trackCouponUsage_result(this);
7116
    }
7117
 
3430 rajveer 7118
    @Override
7119
    public void clear() {
7120
      this.pex = null;
1982 varun.gupt 7121
    }
7122
 
7123
    public PromotionException getPex() {
7124
      return this.pex;
7125
    }
7126
 
3430 rajveer 7127
    public void setPex(PromotionException pex) {
1982 varun.gupt 7128
      this.pex = pex;
7129
    }
7130
 
7131
    public void unsetPex() {
7132
      this.pex = null;
7133
    }
7134
 
3430 rajveer 7135
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 7136
    public boolean isSetPex() {
7137
      return this.pex != null;
7138
    }
7139
 
7140
    public void setPexIsSet(boolean value) {
7141
      if (!value) {
7142
        this.pex = null;
7143
      }
7144
    }
7145
 
7146
    public void setFieldValue(_Fields field, Object value) {
7147
      switch (field) {
7148
      case PEX:
7149
        if (value == null) {
7150
          unsetPex();
7151
        } else {
7152
          setPex((PromotionException)value);
7153
        }
7154
        break;
7155
 
7156
      }
7157
    }
7158
 
7159
    public Object getFieldValue(_Fields field) {
7160
      switch (field) {
7161
      case PEX:
7162
        return getPex();
7163
 
7164
      }
7165
      throw new IllegalStateException();
7166
    }
7167
 
3430 rajveer 7168
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
7169
    public boolean isSet(_Fields field) {
7170
      if (field == null) {
7171
        throw new IllegalArgumentException();
7172
      }
1982 varun.gupt 7173
 
7174
      switch (field) {
7175
      case PEX:
7176
        return isSetPex();
7177
      }
7178
      throw new IllegalStateException();
7179
    }
7180
 
7181
    @Override
7182
    public boolean equals(Object that) {
7183
      if (that == null)
7184
        return false;
7185
      if (that instanceof trackCouponUsage_result)
7186
        return this.equals((trackCouponUsage_result)that);
7187
      return false;
7188
    }
7189
 
7190
    public boolean equals(trackCouponUsage_result that) {
7191
      if (that == null)
7192
        return false;
7193
 
7194
      boolean this_present_pex = true && this.isSetPex();
7195
      boolean that_present_pex = true && that.isSetPex();
7196
      if (this_present_pex || that_present_pex) {
7197
        if (!(this_present_pex && that_present_pex))
7198
          return false;
7199
        if (!this.pex.equals(that.pex))
7200
          return false;
7201
      }
7202
 
7203
      return true;
7204
    }
7205
 
7206
    @Override
7207
    public int hashCode() {
7208
      return 0;
7209
    }
7210
 
7211
    public int compareTo(trackCouponUsage_result other) {
7212
      if (!getClass().equals(other.getClass())) {
7213
        return getClass().getName().compareTo(other.getClass().getName());
7214
      }
7215
 
7216
      int lastComparison = 0;
7217
      trackCouponUsage_result typedOther = (trackCouponUsage_result)other;
7218
 
3430 rajveer 7219
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 7220
      if (lastComparison != 0) {
7221
        return lastComparison;
7222
      }
3430 rajveer 7223
      if (isSetPex()) {
7224
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
7225
        if (lastComparison != 0) {
7226
          return lastComparison;
7227
        }
1982 varun.gupt 7228
      }
7229
      return 0;
7230
    }
7231
 
3430 rajveer 7232
    public _Fields fieldForId(int fieldId) {
7233
      return _Fields.findByThriftId(fieldId);
7234
    }
7235
 
7236
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
7237
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 7238
      iprot.readStructBegin();
7239
      while (true)
7240
      {
7241
        field = iprot.readFieldBegin();
3430 rajveer 7242
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 7243
          break;
7244
        }
3430 rajveer 7245
        switch (field.id) {
7246
          case 1: // PEX
7247
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
7248
              this.pex = new PromotionException();
7249
              this.pex.read(iprot);
7250
            } else { 
7251
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7252
            }
7253
            break;
7254
          default:
7255
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 7256
        }
3430 rajveer 7257
        iprot.readFieldEnd();
1982 varun.gupt 7258
      }
7259
      iprot.readStructEnd();
7260
      validate();
7261
    }
7262
 
3430 rajveer 7263
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 7264
      oprot.writeStructBegin(STRUCT_DESC);
7265
 
7266
      if (this.isSetPex()) {
7267
        oprot.writeFieldBegin(PEX_FIELD_DESC);
7268
        this.pex.write(oprot);
7269
        oprot.writeFieldEnd();
7270
      }
7271
      oprot.writeFieldStop();
7272
      oprot.writeStructEnd();
7273
    }
7274
 
7275
    @Override
7276
    public String toString() {
7277
      StringBuilder sb = new StringBuilder("trackCouponUsage_result(");
7278
      boolean first = true;
7279
 
7280
      sb.append("pex:");
7281
      if (this.pex == null) {
7282
        sb.append("null");
7283
      } else {
7284
        sb.append(this.pex);
7285
      }
7286
      first = false;
7287
      sb.append(")");
7288
      return sb.toString();
7289
    }
7290
 
3430 rajveer 7291
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 7292
      // check for required fields
7293
    }
7294
 
3430 rajveer 7295
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
7296
      try {
7297
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
7298
      } catch (org.apache.thrift.TException te) {
7299
        throw new java.io.IOException(te);
7300
      }
7301
    }
7302
 
7303
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
7304
      try {
7305
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
7306
      } catch (org.apache.thrift.TException te) {
7307
        throw new java.io.IOException(te);
7308
      }
7309
    }
7310
 
1982 varun.gupt 7311
  }
7312
 
3430 rajveer 7313
  public static class getCouponUsageCountByUser_args implements org.apache.thrift.TBase<getCouponUsageCountByUser_args, getCouponUsageCountByUser_args._Fields>, java.io.Serializable, Cloneable   {
7314
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCouponUsageCountByUser_args");
1982 varun.gupt 7315
 
3430 rajveer 7316
    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);
7317
    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 7318
 
3430 rajveer 7319
    private String couponCode; // required
7320
    private long userId; // required
1982 varun.gupt 7321
 
7322
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 7323
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 7324
      COUPON_CODE((short)1, "couponCode"),
7325
      USER_ID((short)2, "userId");
7326
 
7327
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7328
 
7329
      static {
7330
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7331
          byName.put(field.getFieldName(), field);
7332
        }
7333
      }
7334
 
7335
      /**
7336
       * Find the _Fields constant that matches fieldId, or null if its not found.
7337
       */
7338
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 7339
        switch(fieldId) {
7340
          case 1: // COUPON_CODE
7341
            return COUPON_CODE;
7342
          case 2: // USER_ID
7343
            return USER_ID;
7344
          default:
7345
            return null;
7346
        }
1982 varun.gupt 7347
      }
7348
 
7349
      /**
7350
       * Find the _Fields constant that matches fieldId, throwing an exception
7351
       * if it is not found.
7352
       */
7353
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7354
        _Fields fields = findByThriftId(fieldId);
7355
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7356
        return fields;
7357
      }
7358
 
7359
      /**
7360
       * Find the _Fields constant that matches name, or null if its not found.
7361
       */
7362
      public static _Fields findByName(String name) {
7363
        return byName.get(name);
7364
      }
7365
 
7366
      private final short _thriftId;
7367
      private final String _fieldName;
7368
 
7369
      _Fields(short thriftId, String fieldName) {
7370
        _thriftId = thriftId;
7371
        _fieldName = fieldName;
7372
      }
7373
 
7374
      public short getThriftFieldId() {
7375
        return _thriftId;
7376
      }
7377
 
7378
      public String getFieldName() {
7379
        return _fieldName;
7380
      }
7381
    }
7382
 
7383
    // isset id assignments
7384
    private static final int __USERID_ISSET_ID = 0;
7385
    private BitSet __isset_bit_vector = new BitSet(1);
7386
 
3430 rajveer 7387
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 7388
    static {
3430 rajveer 7389
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
7390
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7391
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
7392
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7393
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
7394
      metaDataMap = Collections.unmodifiableMap(tmpMap);
7395
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCouponUsageCountByUser_args.class, metaDataMap);
1982 varun.gupt 7396
    }
7397
 
7398
    public getCouponUsageCountByUser_args() {
7399
    }
7400
 
7401
    public getCouponUsageCountByUser_args(
7402
      String couponCode,
7403
      long userId)
7404
    {
7405
      this();
7406
      this.couponCode = couponCode;
7407
      this.userId = userId;
7408
      setUserIdIsSet(true);
7409
    }
7410
 
7411
    /**
7412
     * Performs a deep copy on <i>other</i>.
7413
     */
7414
    public getCouponUsageCountByUser_args(getCouponUsageCountByUser_args other) {
7415
      __isset_bit_vector.clear();
7416
      __isset_bit_vector.or(other.__isset_bit_vector);
7417
      if (other.isSetCouponCode()) {
7418
        this.couponCode = other.couponCode;
7419
      }
7420
      this.userId = other.userId;
7421
    }
7422
 
7423
    public getCouponUsageCountByUser_args deepCopy() {
7424
      return new getCouponUsageCountByUser_args(this);
7425
    }
7426
 
3430 rajveer 7427
    @Override
7428
    public void clear() {
7429
      this.couponCode = null;
7430
      setUserIdIsSet(false);
7431
      this.userId = 0;
1982 varun.gupt 7432
    }
7433
 
7434
    public String getCouponCode() {
7435
      return this.couponCode;
7436
    }
7437
 
3430 rajveer 7438
    public void setCouponCode(String couponCode) {
1982 varun.gupt 7439
      this.couponCode = couponCode;
7440
    }
7441
 
7442
    public void unsetCouponCode() {
7443
      this.couponCode = null;
7444
    }
7445
 
3430 rajveer 7446
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 7447
    public boolean isSetCouponCode() {
7448
      return this.couponCode != null;
7449
    }
7450
 
7451
    public void setCouponCodeIsSet(boolean value) {
7452
      if (!value) {
7453
        this.couponCode = null;
7454
      }
7455
    }
7456
 
7457
    public long getUserId() {
7458
      return this.userId;
7459
    }
7460
 
3430 rajveer 7461
    public void setUserId(long userId) {
1982 varun.gupt 7462
      this.userId = userId;
7463
      setUserIdIsSet(true);
7464
    }
7465
 
7466
    public void unsetUserId() {
7467
      __isset_bit_vector.clear(__USERID_ISSET_ID);
7468
    }
7469
 
3430 rajveer 7470
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 7471
    public boolean isSetUserId() {
7472
      return __isset_bit_vector.get(__USERID_ISSET_ID);
7473
    }
7474
 
7475
    public void setUserIdIsSet(boolean value) {
7476
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
7477
    }
7478
 
7479
    public void setFieldValue(_Fields field, Object value) {
7480
      switch (field) {
7481
      case COUPON_CODE:
7482
        if (value == null) {
7483
          unsetCouponCode();
7484
        } else {
7485
          setCouponCode((String)value);
7486
        }
7487
        break;
7488
 
7489
      case USER_ID:
7490
        if (value == null) {
7491
          unsetUserId();
7492
        } else {
7493
          setUserId((Long)value);
7494
        }
7495
        break;
7496
 
7497
      }
7498
    }
7499
 
7500
    public Object getFieldValue(_Fields field) {
7501
      switch (field) {
7502
      case COUPON_CODE:
7503
        return getCouponCode();
7504
 
7505
      case USER_ID:
3430 rajveer 7506
        return Long.valueOf(getUserId());
1982 varun.gupt 7507
 
7508
      }
7509
      throw new IllegalStateException();
7510
    }
7511
 
3430 rajveer 7512
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
7513
    public boolean isSet(_Fields field) {
7514
      if (field == null) {
7515
        throw new IllegalArgumentException();
7516
      }
1982 varun.gupt 7517
 
7518
      switch (field) {
7519
      case COUPON_CODE:
7520
        return isSetCouponCode();
7521
      case USER_ID:
7522
        return isSetUserId();
7523
      }
7524
      throw new IllegalStateException();
7525
    }
7526
 
7527
    @Override
7528
    public boolean equals(Object that) {
7529
      if (that == null)
7530
        return false;
7531
      if (that instanceof getCouponUsageCountByUser_args)
7532
        return this.equals((getCouponUsageCountByUser_args)that);
7533
      return false;
7534
    }
7535
 
7536
    public boolean equals(getCouponUsageCountByUser_args that) {
7537
      if (that == null)
7538
        return false;
7539
 
7540
      boolean this_present_couponCode = true && this.isSetCouponCode();
7541
      boolean that_present_couponCode = true && that.isSetCouponCode();
7542
      if (this_present_couponCode || that_present_couponCode) {
7543
        if (!(this_present_couponCode && that_present_couponCode))
7544
          return false;
7545
        if (!this.couponCode.equals(that.couponCode))
7546
          return false;
7547
      }
7548
 
7549
      boolean this_present_userId = true;
7550
      boolean that_present_userId = true;
7551
      if (this_present_userId || that_present_userId) {
7552
        if (!(this_present_userId && that_present_userId))
7553
          return false;
7554
        if (this.userId != that.userId)
7555
          return false;
7556
      }
7557
 
7558
      return true;
7559
    }
7560
 
7561
    @Override
7562
    public int hashCode() {
7563
      return 0;
7564
    }
7565
 
7566
    public int compareTo(getCouponUsageCountByUser_args other) {
7567
      if (!getClass().equals(other.getClass())) {
7568
        return getClass().getName().compareTo(other.getClass().getName());
7569
      }
7570
 
7571
      int lastComparison = 0;
7572
      getCouponUsageCountByUser_args typedOther = (getCouponUsageCountByUser_args)other;
7573
 
3430 rajveer 7574
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 7575
      if (lastComparison != 0) {
7576
        return lastComparison;
7577
      }
3430 rajveer 7578
      if (isSetCouponCode()) {
7579
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
7580
        if (lastComparison != 0) {
7581
          return lastComparison;
7582
        }
1982 varun.gupt 7583
      }
3430 rajveer 7584
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
1982 varun.gupt 7585
      if (lastComparison != 0) {
7586
        return lastComparison;
7587
      }
3430 rajveer 7588
      if (isSetUserId()) {
7589
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
7590
        if (lastComparison != 0) {
7591
          return lastComparison;
7592
        }
1982 varun.gupt 7593
      }
7594
      return 0;
7595
    }
7596
 
3430 rajveer 7597
    public _Fields fieldForId(int fieldId) {
7598
      return _Fields.findByThriftId(fieldId);
7599
    }
7600
 
7601
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
7602
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 7603
      iprot.readStructBegin();
7604
      while (true)
7605
      {
7606
        field = iprot.readFieldBegin();
3430 rajveer 7607
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 7608
          break;
7609
        }
3430 rajveer 7610
        switch (field.id) {
7611
          case 1: // COUPON_CODE
7612
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
7613
              this.couponCode = iprot.readString();
7614
            } else { 
7615
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7616
            }
7617
            break;
7618
          case 2: // USER_ID
7619
            if (field.type == org.apache.thrift.protocol.TType.I64) {
7620
              this.userId = iprot.readI64();
7621
              setUserIdIsSet(true);
7622
            } else { 
7623
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7624
            }
7625
            break;
7626
          default:
7627
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 7628
        }
3430 rajveer 7629
        iprot.readFieldEnd();
1982 varun.gupt 7630
      }
7631
      iprot.readStructEnd();
7632
      validate();
7633
    }
7634
 
3430 rajveer 7635
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 7636
      validate();
7637
 
7638
      oprot.writeStructBegin(STRUCT_DESC);
7639
      if (this.couponCode != null) {
7640
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
7641
        oprot.writeString(this.couponCode);
7642
        oprot.writeFieldEnd();
7643
      }
7644
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
7645
      oprot.writeI64(this.userId);
7646
      oprot.writeFieldEnd();
7647
      oprot.writeFieldStop();
7648
      oprot.writeStructEnd();
7649
    }
7650
 
7651
    @Override
7652
    public String toString() {
7653
      StringBuilder sb = new StringBuilder("getCouponUsageCountByUser_args(");
7654
      boolean first = true;
7655
 
7656
      sb.append("couponCode:");
7657
      if (this.couponCode == null) {
7658
        sb.append("null");
7659
      } else {
7660
        sb.append(this.couponCode);
7661
      }
7662
      first = false;
7663
      if (!first) sb.append(", ");
7664
      sb.append("userId:");
7665
      sb.append(this.userId);
7666
      first = false;
7667
      sb.append(")");
7668
      return sb.toString();
7669
    }
7670
 
3430 rajveer 7671
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 7672
      // check for required fields
7673
    }
7674
 
3430 rajveer 7675
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
7676
      try {
7677
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
7678
      } catch (org.apache.thrift.TException te) {
7679
        throw new java.io.IOException(te);
7680
      }
7681
    }
7682
 
7683
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
7684
      try {
7685
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
7686
        __isset_bit_vector = new BitSet(1);
7687
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
7688
      } catch (org.apache.thrift.TException te) {
7689
        throw new java.io.IOException(te);
7690
      }
7691
    }
7692
 
1982 varun.gupt 7693
  }
7694
 
3430 rajveer 7695
  public static class getCouponUsageCountByUser_result implements org.apache.thrift.TBase<getCouponUsageCountByUser_result, getCouponUsageCountByUser_result._Fields>, java.io.Serializable, Cloneable   {
7696
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCouponUsageCountByUser_result");
1982 varun.gupt 7697
 
3430 rajveer 7698
    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);
7699
    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 7700
 
3430 rajveer 7701
    private long success; // required
7702
    private PromotionException pex; // required
1982 varun.gupt 7703
 
7704
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 7705
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 7706
      SUCCESS((short)0, "success"),
7707
      PEX((short)1, "pex");
7708
 
7709
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7710
 
7711
      static {
7712
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7713
          byName.put(field.getFieldName(), field);
7714
        }
7715
      }
7716
 
7717
      /**
7718
       * Find the _Fields constant that matches fieldId, or null if its not found.
7719
       */
7720
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 7721
        switch(fieldId) {
7722
          case 0: // SUCCESS
7723
            return SUCCESS;
7724
          case 1: // PEX
7725
            return PEX;
7726
          default:
7727
            return null;
7728
        }
1982 varun.gupt 7729
      }
7730
 
7731
      /**
7732
       * Find the _Fields constant that matches fieldId, throwing an exception
7733
       * if it is not found.
7734
       */
7735
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7736
        _Fields fields = findByThriftId(fieldId);
7737
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7738
        return fields;
7739
      }
7740
 
7741
      /**
7742
       * Find the _Fields constant that matches name, or null if its not found.
7743
       */
7744
      public static _Fields findByName(String name) {
7745
        return byName.get(name);
7746
      }
7747
 
7748
      private final short _thriftId;
7749
      private final String _fieldName;
7750
 
7751
      _Fields(short thriftId, String fieldName) {
7752
        _thriftId = thriftId;
7753
        _fieldName = fieldName;
7754
      }
7755
 
7756
      public short getThriftFieldId() {
7757
        return _thriftId;
7758
      }
7759
 
7760
      public String getFieldName() {
7761
        return _fieldName;
7762
      }
7763
    }
7764
 
7765
    // isset id assignments
7766
    private static final int __SUCCESS_ISSET_ID = 0;
7767
    private BitSet __isset_bit_vector = new BitSet(1);
7768
 
3430 rajveer 7769
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 7770
    static {
3430 rajveer 7771
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
7772
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7773
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
7774
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7775
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
7776
      metaDataMap = Collections.unmodifiableMap(tmpMap);
7777
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCouponUsageCountByUser_result.class, metaDataMap);
1982 varun.gupt 7778
    }
7779
 
7780
    public getCouponUsageCountByUser_result() {
7781
    }
7782
 
7783
    public getCouponUsageCountByUser_result(
7784
      long success,
7785
      PromotionException pex)
7786
    {
7787
      this();
7788
      this.success = success;
7789
      setSuccessIsSet(true);
7790
      this.pex = pex;
7791
    }
7792
 
7793
    /**
7794
     * Performs a deep copy on <i>other</i>.
7795
     */
7796
    public getCouponUsageCountByUser_result(getCouponUsageCountByUser_result other) {
7797
      __isset_bit_vector.clear();
7798
      __isset_bit_vector.or(other.__isset_bit_vector);
7799
      this.success = other.success;
7800
      if (other.isSetPex()) {
7801
        this.pex = new PromotionException(other.pex);
7802
      }
7803
    }
7804
 
7805
    public getCouponUsageCountByUser_result deepCopy() {
7806
      return new getCouponUsageCountByUser_result(this);
7807
    }
7808
 
3430 rajveer 7809
    @Override
7810
    public void clear() {
7811
      setSuccessIsSet(false);
7812
      this.success = 0;
7813
      this.pex = null;
1982 varun.gupt 7814
    }
7815
 
7816
    public long getSuccess() {
7817
      return this.success;
7818
    }
7819
 
3430 rajveer 7820
    public void setSuccess(long success) {
1982 varun.gupt 7821
      this.success = success;
7822
      setSuccessIsSet(true);
7823
    }
7824
 
7825
    public void unsetSuccess() {
7826
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
7827
    }
7828
 
3430 rajveer 7829
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 7830
    public boolean isSetSuccess() {
7831
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
7832
    }
7833
 
7834
    public void setSuccessIsSet(boolean value) {
7835
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
7836
    }
7837
 
7838
    public PromotionException getPex() {
7839
      return this.pex;
7840
    }
7841
 
3430 rajveer 7842
    public void setPex(PromotionException pex) {
1982 varun.gupt 7843
      this.pex = pex;
7844
    }
7845
 
7846
    public void unsetPex() {
7847
      this.pex = null;
7848
    }
7849
 
3430 rajveer 7850
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 7851
    public boolean isSetPex() {
7852
      return this.pex != null;
7853
    }
7854
 
7855
    public void setPexIsSet(boolean value) {
7856
      if (!value) {
7857
        this.pex = null;
7858
      }
7859
    }
7860
 
7861
    public void setFieldValue(_Fields field, Object value) {
7862
      switch (field) {
7863
      case SUCCESS:
7864
        if (value == null) {
7865
          unsetSuccess();
7866
        } else {
7867
          setSuccess((Long)value);
7868
        }
7869
        break;
7870
 
7871
      case PEX:
7872
        if (value == null) {
7873
          unsetPex();
7874
        } else {
7875
          setPex((PromotionException)value);
7876
        }
7877
        break;
7878
 
7879
      }
7880
    }
7881
 
7882
    public Object getFieldValue(_Fields field) {
7883
      switch (field) {
7884
      case SUCCESS:
3430 rajveer 7885
        return Long.valueOf(getSuccess());
1982 varun.gupt 7886
 
7887
      case PEX:
7888
        return getPex();
7889
 
7890
      }
7891
      throw new IllegalStateException();
7892
    }
7893
 
3430 rajveer 7894
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
7895
    public boolean isSet(_Fields field) {
7896
      if (field == null) {
7897
        throw new IllegalArgumentException();
7898
      }
1982 varun.gupt 7899
 
7900
      switch (field) {
7901
      case SUCCESS:
7902
        return isSetSuccess();
7903
      case PEX:
7904
        return isSetPex();
7905
      }
7906
      throw new IllegalStateException();
7907
    }
7908
 
7909
    @Override
7910
    public boolean equals(Object that) {
7911
      if (that == null)
7912
        return false;
7913
      if (that instanceof getCouponUsageCountByUser_result)
7914
        return this.equals((getCouponUsageCountByUser_result)that);
7915
      return false;
7916
    }
7917
 
7918
    public boolean equals(getCouponUsageCountByUser_result that) {
7919
      if (that == null)
7920
        return false;
7921
 
7922
      boolean this_present_success = true;
7923
      boolean that_present_success = true;
7924
      if (this_present_success || that_present_success) {
7925
        if (!(this_present_success && that_present_success))
7926
          return false;
7927
        if (this.success != that.success)
7928
          return false;
7929
      }
7930
 
7931
      boolean this_present_pex = true && this.isSetPex();
7932
      boolean that_present_pex = true && that.isSetPex();
7933
      if (this_present_pex || that_present_pex) {
7934
        if (!(this_present_pex && that_present_pex))
7935
          return false;
7936
        if (!this.pex.equals(that.pex))
7937
          return false;
7938
      }
7939
 
7940
      return true;
7941
    }
7942
 
7943
    @Override
7944
    public int hashCode() {
7945
      return 0;
7946
    }
7947
 
7948
    public int compareTo(getCouponUsageCountByUser_result other) {
7949
      if (!getClass().equals(other.getClass())) {
7950
        return getClass().getName().compareTo(other.getClass().getName());
7951
      }
7952
 
7953
      int lastComparison = 0;
7954
      getCouponUsageCountByUser_result typedOther = (getCouponUsageCountByUser_result)other;
7955
 
3430 rajveer 7956
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 7957
      if (lastComparison != 0) {
7958
        return lastComparison;
7959
      }
3430 rajveer 7960
      if (isSetSuccess()) {
7961
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
7962
        if (lastComparison != 0) {
7963
          return lastComparison;
7964
        }
1982 varun.gupt 7965
      }
3430 rajveer 7966
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 7967
      if (lastComparison != 0) {
7968
        return lastComparison;
7969
      }
3430 rajveer 7970
      if (isSetPex()) {
7971
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
7972
        if (lastComparison != 0) {
7973
          return lastComparison;
7974
        }
1982 varun.gupt 7975
      }
7976
      return 0;
7977
    }
7978
 
3430 rajveer 7979
    public _Fields fieldForId(int fieldId) {
7980
      return _Fields.findByThriftId(fieldId);
7981
    }
7982
 
7983
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
7984
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 7985
      iprot.readStructBegin();
7986
      while (true)
7987
      {
7988
        field = iprot.readFieldBegin();
3430 rajveer 7989
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 7990
          break;
7991
        }
3430 rajveer 7992
        switch (field.id) {
7993
          case 0: // SUCCESS
7994
            if (field.type == org.apache.thrift.protocol.TType.I64) {
7995
              this.success = iprot.readI64();
7996
              setSuccessIsSet(true);
7997
            } else { 
7998
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7999
            }
8000
            break;
8001
          case 1: // PEX
8002
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
8003
              this.pex = new PromotionException();
8004
              this.pex.read(iprot);
8005
            } else { 
8006
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8007
            }
8008
            break;
8009
          default:
8010
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 8011
        }
3430 rajveer 8012
        iprot.readFieldEnd();
1982 varun.gupt 8013
      }
8014
      iprot.readStructEnd();
8015
      validate();
8016
    }
8017
 
3430 rajveer 8018
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 8019
      oprot.writeStructBegin(STRUCT_DESC);
8020
 
8021
      if (this.isSetSuccess()) {
8022
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
8023
        oprot.writeI64(this.success);
8024
        oprot.writeFieldEnd();
8025
      } else if (this.isSetPex()) {
8026
        oprot.writeFieldBegin(PEX_FIELD_DESC);
8027
        this.pex.write(oprot);
8028
        oprot.writeFieldEnd();
8029
      }
8030
      oprot.writeFieldStop();
8031
      oprot.writeStructEnd();
8032
    }
8033
 
8034
    @Override
8035
    public String toString() {
8036
      StringBuilder sb = new StringBuilder("getCouponUsageCountByUser_result(");
8037
      boolean first = true;
8038
 
8039
      sb.append("success:");
8040
      sb.append(this.success);
8041
      first = false;
8042
      if (!first) sb.append(", ");
8043
      sb.append("pex:");
8044
      if (this.pex == null) {
8045
        sb.append("null");
8046
      } else {
8047
        sb.append(this.pex);
8048
      }
8049
      first = false;
8050
      sb.append(")");
8051
      return sb.toString();
8052
    }
8053
 
3430 rajveer 8054
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 8055
      // check for required fields
8056
    }
8057
 
3430 rajveer 8058
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
8059
      try {
8060
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
8061
      } catch (org.apache.thrift.TException te) {
8062
        throw new java.io.IOException(te);
8063
      }
8064
    }
8065
 
8066
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
8067
      try {
8068
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
8069
      } catch (org.apache.thrift.TException te) {
8070
        throw new java.io.IOException(te);
8071
      }
8072
    }
8073
 
1982 varun.gupt 8074
  }
8075
 
3430 rajveer 8076
  public static class getActiveCoupons_args implements org.apache.thrift.TBase<getActiveCoupons_args, getActiveCoupons_args._Fields>, java.io.Serializable, Cloneable   {
8077
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActiveCoupons_args");
3385 varun.gupt 8078
 
8079
 
8080
 
8081
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 8082
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 8083
;
8084
 
8085
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8086
 
8087
      static {
8088
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8089
          byName.put(field.getFieldName(), field);
8090
        }
8091
      }
8092
 
8093
      /**
8094
       * Find the _Fields constant that matches fieldId, or null if its not found.
8095
       */
8096
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 8097
        switch(fieldId) {
8098
          default:
8099
            return null;
8100
        }
3385 varun.gupt 8101
      }
8102
 
8103
      /**
8104
       * Find the _Fields constant that matches fieldId, throwing an exception
8105
       * if it is not found.
8106
       */
8107
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8108
        _Fields fields = findByThriftId(fieldId);
8109
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8110
        return fields;
8111
      }
8112
 
8113
      /**
8114
       * Find the _Fields constant that matches name, or null if its not found.
8115
       */
8116
      public static _Fields findByName(String name) {
8117
        return byName.get(name);
8118
      }
8119
 
8120
      private final short _thriftId;
8121
      private final String _fieldName;
8122
 
8123
      _Fields(short thriftId, String fieldName) {
8124
        _thriftId = thriftId;
8125
        _fieldName = fieldName;
8126
      }
8127
 
8128
      public short getThriftFieldId() {
8129
        return _thriftId;
8130
      }
8131
 
8132
      public String getFieldName() {
8133
        return _fieldName;
8134
      }
8135
    }
3430 rajveer 8136
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 8137
    static {
3430 rajveer 8138
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
8139
      metaDataMap = Collections.unmodifiableMap(tmpMap);
8140
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActiveCoupons_args.class, metaDataMap);
3385 varun.gupt 8141
    }
8142
 
8143
    public getActiveCoupons_args() {
8144
    }
8145
 
8146
    /**
8147
     * Performs a deep copy on <i>other</i>.
8148
     */
8149
    public getActiveCoupons_args(getActiveCoupons_args other) {
8150
    }
8151
 
8152
    public getActiveCoupons_args deepCopy() {
8153
      return new getActiveCoupons_args(this);
8154
    }
8155
 
3430 rajveer 8156
    @Override
8157
    public void clear() {
3385 varun.gupt 8158
    }
8159
 
8160
    public void setFieldValue(_Fields field, Object value) {
8161
      switch (field) {
8162
      }
8163
    }
8164
 
8165
    public Object getFieldValue(_Fields field) {
8166
      switch (field) {
8167
      }
8168
      throw new IllegalStateException();
8169
    }
8170
 
3430 rajveer 8171
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
8172
    public boolean isSet(_Fields field) {
8173
      if (field == null) {
8174
        throw new IllegalArgumentException();
8175
      }
3385 varun.gupt 8176
 
8177
      switch (field) {
8178
      }
8179
      throw new IllegalStateException();
8180
    }
8181
 
8182
    @Override
8183
    public boolean equals(Object that) {
8184
      if (that == null)
8185
        return false;
8186
      if (that instanceof getActiveCoupons_args)
8187
        return this.equals((getActiveCoupons_args)that);
8188
      return false;
8189
    }
8190
 
8191
    public boolean equals(getActiveCoupons_args that) {
8192
      if (that == null)
8193
        return false;
8194
 
8195
      return true;
8196
    }
8197
 
8198
    @Override
8199
    public int hashCode() {
8200
      return 0;
8201
    }
8202
 
8203
    public int compareTo(getActiveCoupons_args other) {
8204
      if (!getClass().equals(other.getClass())) {
8205
        return getClass().getName().compareTo(other.getClass().getName());
8206
      }
8207
 
8208
      int lastComparison = 0;
8209
      getActiveCoupons_args typedOther = (getActiveCoupons_args)other;
8210
 
8211
      return 0;
8212
    }
8213
 
3430 rajveer 8214
    public _Fields fieldForId(int fieldId) {
8215
      return _Fields.findByThriftId(fieldId);
8216
    }
8217
 
8218
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
8219
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 8220
      iprot.readStructBegin();
8221
      while (true)
8222
      {
8223
        field = iprot.readFieldBegin();
3430 rajveer 8224
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 8225
          break;
8226
        }
3430 rajveer 8227
        switch (field.id) {
8228
          default:
8229
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 8230
        }
3430 rajveer 8231
        iprot.readFieldEnd();
3385 varun.gupt 8232
      }
8233
      iprot.readStructEnd();
8234
      validate();
8235
    }
8236
 
3430 rajveer 8237
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 8238
      validate();
8239
 
8240
      oprot.writeStructBegin(STRUCT_DESC);
8241
      oprot.writeFieldStop();
8242
      oprot.writeStructEnd();
8243
    }
8244
 
8245
    @Override
8246
    public String toString() {
8247
      StringBuilder sb = new StringBuilder("getActiveCoupons_args(");
8248
      boolean first = true;
8249
 
8250
      sb.append(")");
8251
      return sb.toString();
8252
    }
8253
 
3430 rajveer 8254
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 8255
      // check for required fields
8256
    }
8257
 
3430 rajveer 8258
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
8259
      try {
8260
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
8261
      } catch (org.apache.thrift.TException te) {
8262
        throw new java.io.IOException(te);
8263
      }
8264
    }
8265
 
8266
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
8267
      try {
8268
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
8269
      } catch (org.apache.thrift.TException te) {
8270
        throw new java.io.IOException(te);
8271
      }
8272
    }
8273
 
3385 varun.gupt 8274
  }
8275
 
3430 rajveer 8276
  public static class getActiveCoupons_result implements org.apache.thrift.TBase<getActiveCoupons_result, getActiveCoupons_result._Fields>, java.io.Serializable, Cloneable   {
8277
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActiveCoupons_result");
3385 varun.gupt 8278
 
3430 rajveer 8279
    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);
8280
    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 8281
 
3430 rajveer 8282
    private List<Coupon> success; // required
8283
    private PromotionException pex; // required
3385 varun.gupt 8284
 
8285
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 8286
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 8287
      SUCCESS((short)0, "success"),
8288
      PEX((short)1, "pex");
8289
 
8290
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8291
 
8292
      static {
8293
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8294
          byName.put(field.getFieldName(), field);
8295
        }
8296
      }
8297
 
8298
      /**
8299
       * Find the _Fields constant that matches fieldId, or null if its not found.
8300
       */
8301
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 8302
        switch(fieldId) {
8303
          case 0: // SUCCESS
8304
            return SUCCESS;
8305
          case 1: // PEX
8306
            return PEX;
8307
          default:
8308
            return null;
8309
        }
3385 varun.gupt 8310
      }
8311
 
8312
      /**
8313
       * Find the _Fields constant that matches fieldId, throwing an exception
8314
       * if it is not found.
8315
       */
8316
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8317
        _Fields fields = findByThriftId(fieldId);
8318
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8319
        return fields;
8320
      }
8321
 
8322
      /**
8323
       * Find the _Fields constant that matches name, or null if its not found.
8324
       */
8325
      public static _Fields findByName(String name) {
8326
        return byName.get(name);
8327
      }
8328
 
8329
      private final short _thriftId;
8330
      private final String _fieldName;
8331
 
8332
      _Fields(short thriftId, String fieldName) {
8333
        _thriftId = thriftId;
8334
        _fieldName = fieldName;
8335
      }
8336
 
8337
      public short getThriftFieldId() {
8338
        return _thriftId;
8339
      }
8340
 
8341
      public String getFieldName() {
8342
        return _fieldName;
8343
      }
8344
    }
8345
 
8346
    // isset id assignments
8347
 
3430 rajveer 8348
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 8349
    static {
3430 rajveer 8350
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
8351
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8352
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
8353
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Coupon.class))));
8354
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8355
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
8356
      metaDataMap = Collections.unmodifiableMap(tmpMap);
8357
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActiveCoupons_result.class, metaDataMap);
3385 varun.gupt 8358
    }
8359
 
8360
    public getActiveCoupons_result() {
8361
    }
8362
 
8363
    public getActiveCoupons_result(
8364
      List<Coupon> success,
8365
      PromotionException pex)
8366
    {
8367
      this();
8368
      this.success = success;
8369
      this.pex = pex;
8370
    }
8371
 
8372
    /**
8373
     * Performs a deep copy on <i>other</i>.
8374
     */
8375
    public getActiveCoupons_result(getActiveCoupons_result other) {
8376
      if (other.isSetSuccess()) {
8377
        List<Coupon> __this__success = new ArrayList<Coupon>();
8378
        for (Coupon other_element : other.success) {
8379
          __this__success.add(new Coupon(other_element));
8380
        }
8381
        this.success = __this__success;
8382
      }
8383
      if (other.isSetPex()) {
8384
        this.pex = new PromotionException(other.pex);
8385
      }
8386
    }
8387
 
8388
    public getActiveCoupons_result deepCopy() {
8389
      return new getActiveCoupons_result(this);
8390
    }
8391
 
3430 rajveer 8392
    @Override
8393
    public void clear() {
8394
      this.success = null;
8395
      this.pex = null;
3385 varun.gupt 8396
    }
8397
 
8398
    public int getSuccessSize() {
8399
      return (this.success == null) ? 0 : this.success.size();
8400
    }
8401
 
8402
    public java.util.Iterator<Coupon> getSuccessIterator() {
8403
      return (this.success == null) ? null : this.success.iterator();
8404
    }
8405
 
8406
    public void addToSuccess(Coupon elem) {
8407
      if (this.success == null) {
8408
        this.success = new ArrayList<Coupon>();
8409
      }
8410
      this.success.add(elem);
8411
    }
8412
 
8413
    public List<Coupon> getSuccess() {
8414
      return this.success;
8415
    }
8416
 
3430 rajveer 8417
    public void setSuccess(List<Coupon> success) {
3385 varun.gupt 8418
      this.success = success;
8419
    }
8420
 
8421
    public void unsetSuccess() {
8422
      this.success = null;
8423
    }
8424
 
3430 rajveer 8425
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3385 varun.gupt 8426
    public boolean isSetSuccess() {
8427
      return this.success != null;
8428
    }
8429
 
8430
    public void setSuccessIsSet(boolean value) {
8431
      if (!value) {
8432
        this.success = null;
8433
      }
8434
    }
8435
 
8436
    public PromotionException getPex() {
8437
      return this.pex;
8438
    }
8439
 
3430 rajveer 8440
    public void setPex(PromotionException pex) {
3385 varun.gupt 8441
      this.pex = pex;
8442
    }
8443
 
8444
    public void unsetPex() {
8445
      this.pex = null;
8446
    }
8447
 
3430 rajveer 8448
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
3385 varun.gupt 8449
    public boolean isSetPex() {
8450
      return this.pex != null;
8451
    }
8452
 
8453
    public void setPexIsSet(boolean value) {
8454
      if (!value) {
8455
        this.pex = null;
8456
      }
8457
    }
8458
 
8459
    public void setFieldValue(_Fields field, Object value) {
8460
      switch (field) {
8461
      case SUCCESS:
8462
        if (value == null) {
8463
          unsetSuccess();
8464
        } else {
8465
          setSuccess((List<Coupon>)value);
8466
        }
8467
        break;
8468
 
8469
      case PEX:
8470
        if (value == null) {
8471
          unsetPex();
8472
        } else {
8473
          setPex((PromotionException)value);
8474
        }
8475
        break;
8476
 
8477
      }
8478
    }
8479
 
8480
    public Object getFieldValue(_Fields field) {
8481
      switch (field) {
8482
      case SUCCESS:
8483
        return getSuccess();
8484
 
8485
      case PEX:
8486
        return getPex();
8487
 
8488
      }
8489
      throw new IllegalStateException();
8490
    }
8491
 
3430 rajveer 8492
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
8493
    public boolean isSet(_Fields field) {
8494
      if (field == null) {
8495
        throw new IllegalArgumentException();
8496
      }
3385 varun.gupt 8497
 
8498
      switch (field) {
8499
      case SUCCESS:
8500
        return isSetSuccess();
8501
      case PEX:
8502
        return isSetPex();
8503
      }
8504
      throw new IllegalStateException();
8505
    }
8506
 
8507
    @Override
8508
    public boolean equals(Object that) {
8509
      if (that == null)
8510
        return false;
8511
      if (that instanceof getActiveCoupons_result)
8512
        return this.equals((getActiveCoupons_result)that);
8513
      return false;
8514
    }
8515
 
8516
    public boolean equals(getActiveCoupons_result that) {
8517
      if (that == null)
8518
        return false;
8519
 
8520
      boolean this_present_success = true && this.isSetSuccess();
8521
      boolean that_present_success = true && that.isSetSuccess();
8522
      if (this_present_success || that_present_success) {
8523
        if (!(this_present_success && that_present_success))
8524
          return false;
8525
        if (!this.success.equals(that.success))
8526
          return false;
8527
      }
8528
 
8529
      boolean this_present_pex = true && this.isSetPex();
8530
      boolean that_present_pex = true && that.isSetPex();
8531
      if (this_present_pex || that_present_pex) {
8532
        if (!(this_present_pex && that_present_pex))
8533
          return false;
8534
        if (!this.pex.equals(that.pex))
8535
          return false;
8536
      }
8537
 
8538
      return true;
8539
    }
8540
 
8541
    @Override
8542
    public int hashCode() {
8543
      return 0;
8544
    }
8545
 
8546
    public int compareTo(getActiveCoupons_result other) {
8547
      if (!getClass().equals(other.getClass())) {
8548
        return getClass().getName().compareTo(other.getClass().getName());
8549
      }
8550
 
8551
      int lastComparison = 0;
8552
      getActiveCoupons_result typedOther = (getActiveCoupons_result)other;
8553
 
3430 rajveer 8554
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3385 varun.gupt 8555
      if (lastComparison != 0) {
8556
        return lastComparison;
8557
      }
3430 rajveer 8558
      if (isSetSuccess()) {
8559
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
8560
        if (lastComparison != 0) {
8561
          return lastComparison;
8562
        }
3385 varun.gupt 8563
      }
3430 rajveer 8564
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
3385 varun.gupt 8565
      if (lastComparison != 0) {
8566
        return lastComparison;
8567
      }
3430 rajveer 8568
      if (isSetPex()) {
8569
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
8570
        if (lastComparison != 0) {
8571
          return lastComparison;
8572
        }
3385 varun.gupt 8573
      }
8574
      return 0;
8575
    }
8576
 
3430 rajveer 8577
    public _Fields fieldForId(int fieldId) {
8578
      return _Fields.findByThriftId(fieldId);
8579
    }
8580
 
8581
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
8582
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 8583
      iprot.readStructBegin();
8584
      while (true)
8585
      {
8586
        field = iprot.readFieldBegin();
3430 rajveer 8587
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 8588
          break;
8589
        }
3430 rajveer 8590
        switch (field.id) {
8591
          case 0: // SUCCESS
8592
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
8593
              {
5327 rajveer 8594
                org.apache.thrift.protocol.TList _list16 = iprot.readListBegin();
8595
                this.success = new ArrayList<Coupon>(_list16.size);
8596
                for (int _i17 = 0; _i17 < _list16.size; ++_i17)
3385 varun.gupt 8597
                {
5327 rajveer 8598
                  Coupon _elem18; // required
8599
                  _elem18 = new Coupon();
8600
                  _elem18.read(iprot);
8601
                  this.success.add(_elem18);
3385 varun.gupt 8602
                }
3430 rajveer 8603
                iprot.readListEnd();
3385 varun.gupt 8604
              }
3430 rajveer 8605
            } else { 
8606
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8607
            }
8608
            break;
8609
          case 1: // PEX
8610
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
8611
              this.pex = new PromotionException();
8612
              this.pex.read(iprot);
8613
            } else { 
8614
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8615
            }
8616
            break;
8617
          default:
8618
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 8619
        }
3430 rajveer 8620
        iprot.readFieldEnd();
3385 varun.gupt 8621
      }
8622
      iprot.readStructEnd();
8623
      validate();
8624
    }
8625
 
3430 rajveer 8626
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 8627
      oprot.writeStructBegin(STRUCT_DESC);
8628
 
8629
      if (this.isSetSuccess()) {
8630
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
8631
        {
3430 rajveer 8632
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
5327 rajveer 8633
          for (Coupon _iter19 : this.success)
3385 varun.gupt 8634
          {
5327 rajveer 8635
            _iter19.write(oprot);
3385 varun.gupt 8636
          }
8637
          oprot.writeListEnd();
8638
        }
8639
        oprot.writeFieldEnd();
8640
      } else if (this.isSetPex()) {
8641
        oprot.writeFieldBegin(PEX_FIELD_DESC);
8642
        this.pex.write(oprot);
8643
        oprot.writeFieldEnd();
8644
      }
8645
      oprot.writeFieldStop();
8646
      oprot.writeStructEnd();
8647
    }
8648
 
8649
    @Override
8650
    public String toString() {
8651
      StringBuilder sb = new StringBuilder("getActiveCoupons_result(");
8652
      boolean first = true;
8653
 
8654
      sb.append("success:");
8655
      if (this.success == null) {
8656
        sb.append("null");
8657
      } else {
8658
        sb.append(this.success);
8659
      }
8660
      first = false;
8661
      if (!first) sb.append(", ");
8662
      sb.append("pex:");
8663
      if (this.pex == null) {
8664
        sb.append("null");
8665
      } else {
8666
        sb.append(this.pex);
8667
      }
8668
      first = false;
8669
      sb.append(")");
8670
      return sb.toString();
8671
    }
8672
 
3430 rajveer 8673
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 8674
      // check for required fields
8675
    }
8676
 
3430 rajveer 8677
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
8678
      try {
8679
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
8680
      } catch (org.apache.thrift.TException te) {
8681
        throw new java.io.IOException(te);
8682
      }
8683
    }
8684
 
8685
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
8686
      try {
8687
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
8688
      } catch (org.apache.thrift.TException te) {
8689
        throw new java.io.IOException(te);
8690
      }
8691
    }
8692
 
3385 varun.gupt 8693
  }
8694
 
6250 amit.gupta 8695
  public static class createCoupon_args implements org.apache.thrift.TBase<createCoupon_args, createCoupon_args._Fields>, java.io.Serializable, Cloneable   {
8696
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createCoupon_args");
8697
 
8698
    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);
8699
    private static final org.apache.thrift.protocol.TField END_ON_FIELD_DESC = new org.apache.thrift.protocol.TField("endOn", org.apache.thrift.protocol.TType.I64, (short)2);
8700
    private static final org.apache.thrift.protocol.TField EMAIL_FIELD_DESC = new org.apache.thrift.protocol.TField("email", org.apache.thrift.protocol.TType.STRING, (short)3);
8701
    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);
8702
    private static final org.apache.thrift.protocol.TField USAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("usage", org.apache.thrift.protocol.TType.I64, (short)5);
8703
 
8704
    private long promotionId; // required
8705
    private long endOn; // required
8706
    private String email; // required
8707
    private long amount; // required
8708
    private long usage; // required
8709
 
8710
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
8711
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
8712
      PROMOTION_ID((short)1, "promotionId"),
8713
      END_ON((short)2, "endOn"),
8714
      EMAIL((short)3, "email"),
8715
      AMOUNT((short)4, "amount"),
8716
      USAGE((short)5, "usage");
8717
 
8718
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8719
 
8720
      static {
8721
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8722
          byName.put(field.getFieldName(), field);
8723
        }
8724
      }
8725
 
8726
      /**
8727
       * Find the _Fields constant that matches fieldId, or null if its not found.
8728
       */
8729
      public static _Fields findByThriftId(int fieldId) {
8730
        switch(fieldId) {
8731
          case 1: // PROMOTION_ID
8732
            return PROMOTION_ID;
8733
          case 2: // END_ON
8734
            return END_ON;
8735
          case 3: // EMAIL
8736
            return EMAIL;
8737
          case 4: // AMOUNT
8738
            return AMOUNT;
8739
          case 5: // USAGE
8740
            return USAGE;
8741
          default:
8742
            return null;
8743
        }
8744
      }
8745
 
8746
      /**
8747
       * Find the _Fields constant that matches fieldId, throwing an exception
8748
       * if it is not found.
8749
       */
8750
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8751
        _Fields fields = findByThriftId(fieldId);
8752
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8753
        return fields;
8754
      }
8755
 
8756
      /**
8757
       * Find the _Fields constant that matches name, or null if its not found.
8758
       */
8759
      public static _Fields findByName(String name) {
8760
        return byName.get(name);
8761
      }
8762
 
8763
      private final short _thriftId;
8764
      private final String _fieldName;
8765
 
8766
      _Fields(short thriftId, String fieldName) {
8767
        _thriftId = thriftId;
8768
        _fieldName = fieldName;
8769
      }
8770
 
8771
      public short getThriftFieldId() {
8772
        return _thriftId;
8773
      }
8774
 
8775
      public String getFieldName() {
8776
        return _fieldName;
8777
      }
8778
    }
8779
 
8780
    // isset id assignments
8781
    private static final int __PROMOTIONID_ISSET_ID = 0;
8782
    private static final int __ENDON_ISSET_ID = 1;
8783
    private static final int __AMOUNT_ISSET_ID = 2;
8784
    private static final int __USAGE_ISSET_ID = 3;
8785
    private BitSet __isset_bit_vector = new BitSet(4);
8786
 
8787
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
8788
    static {
8789
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
8790
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8791
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
8792
      tmpMap.put(_Fields.END_ON, new org.apache.thrift.meta_data.FieldMetaData("endOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8793
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
8794
      tmpMap.put(_Fields.EMAIL, new org.apache.thrift.meta_data.FieldMetaData("email", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8795
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
8796
      tmpMap.put(_Fields.AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("amount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8797
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
8798
      tmpMap.put(_Fields.USAGE, new org.apache.thrift.meta_data.FieldMetaData("usage", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8799
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
8800
      metaDataMap = Collections.unmodifiableMap(tmpMap);
8801
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createCoupon_args.class, metaDataMap);
8802
    }
8803
 
8804
    public createCoupon_args() {
8805
    }
8806
 
8807
    public createCoupon_args(
8808
      long promotionId,
8809
      long endOn,
8810
      String email,
8811
      long amount,
8812
      long usage)
8813
    {
8814
      this();
8815
      this.promotionId = promotionId;
8816
      setPromotionIdIsSet(true);
8817
      this.endOn = endOn;
8818
      setEndOnIsSet(true);
8819
      this.email = email;
8820
      this.amount = amount;
8821
      setAmountIsSet(true);
8822
      this.usage = usage;
8823
      setUsageIsSet(true);
8824
    }
8825
 
8826
    /**
8827
     * Performs a deep copy on <i>other</i>.
8828
     */
8829
    public createCoupon_args(createCoupon_args other) {
8830
      __isset_bit_vector.clear();
8831
      __isset_bit_vector.or(other.__isset_bit_vector);
8832
      this.promotionId = other.promotionId;
8833
      this.endOn = other.endOn;
8834
      if (other.isSetEmail()) {
8835
        this.email = other.email;
8836
      }
8837
      this.amount = other.amount;
8838
      this.usage = other.usage;
8839
    }
8840
 
8841
    public createCoupon_args deepCopy() {
8842
      return new createCoupon_args(this);
8843
    }
8844
 
8845
    @Override
8846
    public void clear() {
8847
      setPromotionIdIsSet(false);
8848
      this.promotionId = 0;
8849
      setEndOnIsSet(false);
8850
      this.endOn = 0;
8851
      this.email = null;
8852
      setAmountIsSet(false);
8853
      this.amount = 0;
8854
      setUsageIsSet(false);
8855
      this.usage = 0;
8856
    }
8857
 
8858
    public long getPromotionId() {
8859
      return this.promotionId;
8860
    }
8861
 
8862
    public void setPromotionId(long promotionId) {
8863
      this.promotionId = promotionId;
8864
      setPromotionIdIsSet(true);
8865
    }
8866
 
8867
    public void unsetPromotionId() {
8868
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
8869
    }
8870
 
8871
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
8872
    public boolean isSetPromotionId() {
8873
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
8874
    }
8875
 
8876
    public void setPromotionIdIsSet(boolean value) {
8877
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
8878
    }
8879
 
8880
    public long getEndOn() {
8881
      return this.endOn;
8882
    }
8883
 
8884
    public void setEndOn(long endOn) {
8885
      this.endOn = endOn;
8886
      setEndOnIsSet(true);
8887
    }
8888
 
8889
    public void unsetEndOn() {
8890
      __isset_bit_vector.clear(__ENDON_ISSET_ID);
8891
    }
8892
 
8893
    /** Returns true if field endOn is set (has been assigned a value) and false otherwise */
8894
    public boolean isSetEndOn() {
8895
      return __isset_bit_vector.get(__ENDON_ISSET_ID);
8896
    }
8897
 
8898
    public void setEndOnIsSet(boolean value) {
8899
      __isset_bit_vector.set(__ENDON_ISSET_ID, value);
8900
    }
8901
 
8902
    public String getEmail() {
8903
      return this.email;
8904
    }
8905
 
8906
    public void setEmail(String email) {
8907
      this.email = email;
8908
    }
8909
 
8910
    public void unsetEmail() {
8911
      this.email = null;
8912
    }
8913
 
8914
    /** Returns true if field email is set (has been assigned a value) and false otherwise */
8915
    public boolean isSetEmail() {
8916
      return this.email != null;
8917
    }
8918
 
8919
    public void setEmailIsSet(boolean value) {
8920
      if (!value) {
8921
        this.email = null;
8922
      }
8923
    }
8924
 
8925
    public long getAmount() {
8926
      return this.amount;
8927
    }
8928
 
8929
    public void setAmount(long amount) {
8930
      this.amount = amount;
8931
      setAmountIsSet(true);
8932
    }
8933
 
8934
    public void unsetAmount() {
8935
      __isset_bit_vector.clear(__AMOUNT_ISSET_ID);
8936
    }
8937
 
8938
    /** Returns true if field amount is set (has been assigned a value) and false otherwise */
8939
    public boolean isSetAmount() {
8940
      return __isset_bit_vector.get(__AMOUNT_ISSET_ID);
8941
    }
8942
 
8943
    public void setAmountIsSet(boolean value) {
8944
      __isset_bit_vector.set(__AMOUNT_ISSET_ID, value);
8945
    }
8946
 
8947
    public long getUsage() {
8948
      return this.usage;
8949
    }
8950
 
8951
    public void setUsage(long usage) {
8952
      this.usage = usage;
8953
      setUsageIsSet(true);
8954
    }
8955
 
8956
    public void unsetUsage() {
8957
      __isset_bit_vector.clear(__USAGE_ISSET_ID);
8958
    }
8959
 
8960
    /** Returns true if field usage is set (has been assigned a value) and false otherwise */
8961
    public boolean isSetUsage() {
8962
      return __isset_bit_vector.get(__USAGE_ISSET_ID);
8963
    }
8964
 
8965
    public void setUsageIsSet(boolean value) {
8966
      __isset_bit_vector.set(__USAGE_ISSET_ID, value);
8967
    }
8968
 
8969
    public void setFieldValue(_Fields field, Object value) {
8970
      switch (field) {
8971
      case PROMOTION_ID:
8972
        if (value == null) {
8973
          unsetPromotionId();
8974
        } else {
8975
          setPromotionId((Long)value);
8976
        }
8977
        break;
8978
 
8979
      case END_ON:
8980
        if (value == null) {
8981
          unsetEndOn();
8982
        } else {
8983
          setEndOn((Long)value);
8984
        }
8985
        break;
8986
 
8987
      case EMAIL:
8988
        if (value == null) {
8989
          unsetEmail();
8990
        } else {
8991
          setEmail((String)value);
8992
        }
8993
        break;
8994
 
8995
      case AMOUNT:
8996
        if (value == null) {
8997
          unsetAmount();
8998
        } else {
8999
          setAmount((Long)value);
9000
        }
9001
        break;
9002
 
9003
      case USAGE:
9004
        if (value == null) {
9005
          unsetUsage();
9006
        } else {
9007
          setUsage((Long)value);
9008
        }
9009
        break;
9010
 
9011
      }
9012
    }
9013
 
9014
    public Object getFieldValue(_Fields field) {
9015
      switch (field) {
9016
      case PROMOTION_ID:
9017
        return Long.valueOf(getPromotionId());
9018
 
9019
      case END_ON:
9020
        return Long.valueOf(getEndOn());
9021
 
9022
      case EMAIL:
9023
        return getEmail();
9024
 
9025
      case AMOUNT:
9026
        return Long.valueOf(getAmount());
9027
 
9028
      case USAGE:
9029
        return Long.valueOf(getUsage());
9030
 
9031
      }
9032
      throw new IllegalStateException();
9033
    }
9034
 
9035
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
9036
    public boolean isSet(_Fields field) {
9037
      if (field == null) {
9038
        throw new IllegalArgumentException();
9039
      }
9040
 
9041
      switch (field) {
9042
      case PROMOTION_ID:
9043
        return isSetPromotionId();
9044
      case END_ON:
9045
        return isSetEndOn();
9046
      case EMAIL:
9047
        return isSetEmail();
9048
      case AMOUNT:
9049
        return isSetAmount();
9050
      case USAGE:
9051
        return isSetUsage();
9052
      }
9053
      throw new IllegalStateException();
9054
    }
9055
 
9056
    @Override
9057
    public boolean equals(Object that) {
9058
      if (that == null)
9059
        return false;
9060
      if (that instanceof createCoupon_args)
9061
        return this.equals((createCoupon_args)that);
9062
      return false;
9063
    }
9064
 
9065
    public boolean equals(createCoupon_args that) {
9066
      if (that == null)
9067
        return false;
9068
 
9069
      boolean this_present_promotionId = true;
9070
      boolean that_present_promotionId = true;
9071
      if (this_present_promotionId || that_present_promotionId) {
9072
        if (!(this_present_promotionId && that_present_promotionId))
9073
          return false;
9074
        if (this.promotionId != that.promotionId)
9075
          return false;
9076
      }
9077
 
9078
      boolean this_present_endOn = true;
9079
      boolean that_present_endOn = true;
9080
      if (this_present_endOn || that_present_endOn) {
9081
        if (!(this_present_endOn && that_present_endOn))
9082
          return false;
9083
        if (this.endOn != that.endOn)
9084
          return false;
9085
      }
9086
 
9087
      boolean this_present_email = true && this.isSetEmail();
9088
      boolean that_present_email = true && that.isSetEmail();
9089
      if (this_present_email || that_present_email) {
9090
        if (!(this_present_email && that_present_email))
9091
          return false;
9092
        if (!this.email.equals(that.email))
9093
          return false;
9094
      }
9095
 
9096
      boolean this_present_amount = true;
9097
      boolean that_present_amount = true;
9098
      if (this_present_amount || that_present_amount) {
9099
        if (!(this_present_amount && that_present_amount))
9100
          return false;
9101
        if (this.amount != that.amount)
9102
          return false;
9103
      }
9104
 
9105
      boolean this_present_usage = true;
9106
      boolean that_present_usage = true;
9107
      if (this_present_usage || that_present_usage) {
9108
        if (!(this_present_usage && that_present_usage))
9109
          return false;
9110
        if (this.usage != that.usage)
9111
          return false;
9112
      }
9113
 
9114
      return true;
9115
    }
9116
 
9117
    @Override
9118
    public int hashCode() {
9119
      return 0;
9120
    }
9121
 
9122
    public int compareTo(createCoupon_args other) {
9123
      if (!getClass().equals(other.getClass())) {
9124
        return getClass().getName().compareTo(other.getClass().getName());
9125
      }
9126
 
9127
      int lastComparison = 0;
9128
      createCoupon_args typedOther = (createCoupon_args)other;
9129
 
9130
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
9131
      if (lastComparison != 0) {
9132
        return lastComparison;
9133
      }
9134
      if (isSetPromotionId()) {
9135
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
9136
        if (lastComparison != 0) {
9137
          return lastComparison;
9138
        }
9139
      }
9140
      lastComparison = Boolean.valueOf(isSetEndOn()).compareTo(typedOther.isSetEndOn());
9141
      if (lastComparison != 0) {
9142
        return lastComparison;
9143
      }
9144
      if (isSetEndOn()) {
9145
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endOn, typedOther.endOn);
9146
        if (lastComparison != 0) {
9147
          return lastComparison;
9148
        }
9149
      }
9150
      lastComparison = Boolean.valueOf(isSetEmail()).compareTo(typedOther.isSetEmail());
9151
      if (lastComparison != 0) {
9152
        return lastComparison;
9153
      }
9154
      if (isSetEmail()) {
9155
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.email, typedOther.email);
9156
        if (lastComparison != 0) {
9157
          return lastComparison;
9158
        }
9159
      }
9160
      lastComparison = Boolean.valueOf(isSetAmount()).compareTo(typedOther.isSetAmount());
9161
      if (lastComparison != 0) {
9162
        return lastComparison;
9163
      }
9164
      if (isSetAmount()) {
9165
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.amount, typedOther.amount);
9166
        if (lastComparison != 0) {
9167
          return lastComparison;
9168
        }
9169
      }
9170
      lastComparison = Boolean.valueOf(isSetUsage()).compareTo(typedOther.isSetUsage());
9171
      if (lastComparison != 0) {
9172
        return lastComparison;
9173
      }
9174
      if (isSetUsage()) {
9175
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.usage, typedOther.usage);
9176
        if (lastComparison != 0) {
9177
          return lastComparison;
9178
        }
9179
      }
9180
      return 0;
9181
    }
9182
 
9183
    public _Fields fieldForId(int fieldId) {
9184
      return _Fields.findByThriftId(fieldId);
9185
    }
9186
 
9187
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
9188
      org.apache.thrift.protocol.TField field;
9189
      iprot.readStructBegin();
9190
      while (true)
9191
      {
9192
        field = iprot.readFieldBegin();
9193
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
9194
          break;
9195
        }
9196
        switch (field.id) {
9197
          case 1: // PROMOTION_ID
9198
            if (field.type == org.apache.thrift.protocol.TType.I64) {
9199
              this.promotionId = iprot.readI64();
9200
              setPromotionIdIsSet(true);
9201
            } else { 
9202
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9203
            }
9204
            break;
9205
          case 2: // END_ON
9206
            if (field.type == org.apache.thrift.protocol.TType.I64) {
9207
              this.endOn = iprot.readI64();
9208
              setEndOnIsSet(true);
9209
            } else { 
9210
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9211
            }
9212
            break;
9213
          case 3: // EMAIL
9214
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
9215
              this.email = iprot.readString();
9216
            } else { 
9217
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9218
            }
9219
            break;
9220
          case 4: // AMOUNT
9221
            if (field.type == org.apache.thrift.protocol.TType.I64) {
9222
              this.amount = iprot.readI64();
9223
              setAmountIsSet(true);
9224
            } else { 
9225
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9226
            }
9227
            break;
9228
          case 5: // USAGE
9229
            if (field.type == org.apache.thrift.protocol.TType.I64) {
9230
              this.usage = iprot.readI64();
9231
              setUsageIsSet(true);
9232
            } else { 
9233
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9234
            }
9235
            break;
9236
          default:
9237
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9238
        }
9239
        iprot.readFieldEnd();
9240
      }
9241
      iprot.readStructEnd();
9242
      validate();
9243
    }
9244
 
9245
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
9246
      validate();
9247
 
9248
      oprot.writeStructBegin(STRUCT_DESC);
9249
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
9250
      oprot.writeI64(this.promotionId);
9251
      oprot.writeFieldEnd();
9252
      oprot.writeFieldBegin(END_ON_FIELD_DESC);
9253
      oprot.writeI64(this.endOn);
9254
      oprot.writeFieldEnd();
9255
      if (this.email != null) {
9256
        oprot.writeFieldBegin(EMAIL_FIELD_DESC);
9257
        oprot.writeString(this.email);
9258
        oprot.writeFieldEnd();
9259
      }
9260
      oprot.writeFieldBegin(AMOUNT_FIELD_DESC);
9261
      oprot.writeI64(this.amount);
9262
      oprot.writeFieldEnd();
9263
      oprot.writeFieldBegin(USAGE_FIELD_DESC);
9264
      oprot.writeI64(this.usage);
9265
      oprot.writeFieldEnd();
9266
      oprot.writeFieldStop();
9267
      oprot.writeStructEnd();
9268
    }
9269
 
9270
    @Override
9271
    public String toString() {
9272
      StringBuilder sb = new StringBuilder("createCoupon_args(");
9273
      boolean first = true;
9274
 
9275
      sb.append("promotionId:");
9276
      sb.append(this.promotionId);
9277
      first = false;
9278
      if (!first) sb.append(", ");
9279
      sb.append("endOn:");
9280
      sb.append(this.endOn);
9281
      first = false;
9282
      if (!first) sb.append(", ");
9283
      sb.append("email:");
9284
      if (this.email == null) {
9285
        sb.append("null");
9286
      } else {
9287
        sb.append(this.email);
9288
      }
9289
      first = false;
9290
      if (!first) sb.append(", ");
9291
      sb.append("amount:");
9292
      sb.append(this.amount);
9293
      first = false;
9294
      if (!first) sb.append(", ");
9295
      sb.append("usage:");
9296
      sb.append(this.usage);
9297
      first = false;
9298
      sb.append(")");
9299
      return sb.toString();
9300
    }
9301
 
9302
    public void validate() throws org.apache.thrift.TException {
9303
      // check for required fields
9304
    }
9305
 
9306
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
9307
      try {
9308
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
9309
      } catch (org.apache.thrift.TException te) {
9310
        throw new java.io.IOException(te);
9311
      }
9312
    }
9313
 
9314
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
9315
      try {
9316
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
9317
      } catch (org.apache.thrift.TException te) {
9318
        throw new java.io.IOException(te);
9319
      }
9320
    }
9321
 
9322
  }
9323
 
9324
  public static class createCoupon_result implements org.apache.thrift.TBase<createCoupon_result, createCoupon_result._Fields>, java.io.Serializable, Cloneable   {
9325
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createCoupon_result");
9326
 
9327
    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);
9328
    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);
9329
 
9330
    private String success; // required
9331
    private PromotionException pex; // required
9332
 
9333
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
9334
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
9335
      SUCCESS((short)0, "success"),
9336
      PEX((short)1, "pex");
9337
 
9338
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
9339
 
9340
      static {
9341
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
9342
          byName.put(field.getFieldName(), field);
9343
        }
9344
      }
9345
 
9346
      /**
9347
       * Find the _Fields constant that matches fieldId, or null if its not found.
9348
       */
9349
      public static _Fields findByThriftId(int fieldId) {
9350
        switch(fieldId) {
9351
          case 0: // SUCCESS
9352
            return SUCCESS;
9353
          case 1: // PEX
9354
            return PEX;
9355
          default:
9356
            return null;
9357
        }
9358
      }
9359
 
9360
      /**
9361
       * Find the _Fields constant that matches fieldId, throwing an exception
9362
       * if it is not found.
9363
       */
9364
      public static _Fields findByThriftIdOrThrow(int fieldId) {
9365
        _Fields fields = findByThriftId(fieldId);
9366
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
9367
        return fields;
9368
      }
9369
 
9370
      /**
9371
       * Find the _Fields constant that matches name, or null if its not found.
9372
       */
9373
      public static _Fields findByName(String name) {
9374
        return byName.get(name);
9375
      }
9376
 
9377
      private final short _thriftId;
9378
      private final String _fieldName;
9379
 
9380
      _Fields(short thriftId, String fieldName) {
9381
        _thriftId = thriftId;
9382
        _fieldName = fieldName;
9383
      }
9384
 
9385
      public short getThriftFieldId() {
9386
        return _thriftId;
9387
      }
9388
 
9389
      public String getFieldName() {
9390
        return _fieldName;
9391
      }
9392
    }
9393
 
9394
    // isset id assignments
9395
 
9396
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
9397
    static {
9398
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
9399
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9400
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
9401
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9402
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
9403
      metaDataMap = Collections.unmodifiableMap(tmpMap);
9404
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createCoupon_result.class, metaDataMap);
9405
    }
9406
 
9407
    public createCoupon_result() {
9408
    }
9409
 
9410
    public createCoupon_result(
9411
      String success,
9412
      PromotionException pex)
9413
    {
9414
      this();
9415
      this.success = success;
9416
      this.pex = pex;
9417
    }
9418
 
9419
    /**
9420
     * Performs a deep copy on <i>other</i>.
9421
     */
9422
    public createCoupon_result(createCoupon_result other) {
9423
      if (other.isSetSuccess()) {
9424
        this.success = other.success;
9425
      }
9426
      if (other.isSetPex()) {
9427
        this.pex = new PromotionException(other.pex);
9428
      }
9429
    }
9430
 
9431
    public createCoupon_result deepCopy() {
9432
      return new createCoupon_result(this);
9433
    }
9434
 
9435
    @Override
9436
    public void clear() {
9437
      this.success = null;
9438
      this.pex = null;
9439
    }
9440
 
9441
    public String getSuccess() {
9442
      return this.success;
9443
    }
9444
 
9445
    public void setSuccess(String success) {
9446
      this.success = success;
9447
    }
9448
 
9449
    public void unsetSuccess() {
9450
      this.success = null;
9451
    }
9452
 
9453
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
9454
    public boolean isSetSuccess() {
9455
      return this.success != null;
9456
    }
9457
 
9458
    public void setSuccessIsSet(boolean value) {
9459
      if (!value) {
9460
        this.success = null;
9461
      }
9462
    }
9463
 
9464
    public PromotionException getPex() {
9465
      return this.pex;
9466
    }
9467
 
9468
    public void setPex(PromotionException pex) {
9469
      this.pex = pex;
9470
    }
9471
 
9472
    public void unsetPex() {
9473
      this.pex = null;
9474
    }
9475
 
9476
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
9477
    public boolean isSetPex() {
9478
      return this.pex != null;
9479
    }
9480
 
9481
    public void setPexIsSet(boolean value) {
9482
      if (!value) {
9483
        this.pex = null;
9484
      }
9485
    }
9486
 
9487
    public void setFieldValue(_Fields field, Object value) {
9488
      switch (field) {
9489
      case SUCCESS:
9490
        if (value == null) {
9491
          unsetSuccess();
9492
        } else {
9493
          setSuccess((String)value);
9494
        }
9495
        break;
9496
 
9497
      case PEX:
9498
        if (value == null) {
9499
          unsetPex();
9500
        } else {
9501
          setPex((PromotionException)value);
9502
        }
9503
        break;
9504
 
9505
      }
9506
    }
9507
 
9508
    public Object getFieldValue(_Fields field) {
9509
      switch (field) {
9510
      case SUCCESS:
9511
        return getSuccess();
9512
 
9513
      case PEX:
9514
        return getPex();
9515
 
9516
      }
9517
      throw new IllegalStateException();
9518
    }
9519
 
9520
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
9521
    public boolean isSet(_Fields field) {
9522
      if (field == null) {
9523
        throw new IllegalArgumentException();
9524
      }
9525
 
9526
      switch (field) {
9527
      case SUCCESS:
9528
        return isSetSuccess();
9529
      case PEX:
9530
        return isSetPex();
9531
      }
9532
      throw new IllegalStateException();
9533
    }
9534
 
9535
    @Override
9536
    public boolean equals(Object that) {
9537
      if (that == null)
9538
        return false;
9539
      if (that instanceof createCoupon_result)
9540
        return this.equals((createCoupon_result)that);
9541
      return false;
9542
    }
9543
 
9544
    public boolean equals(createCoupon_result that) {
9545
      if (that == null)
9546
        return false;
9547
 
9548
      boolean this_present_success = true && this.isSetSuccess();
9549
      boolean that_present_success = true && that.isSetSuccess();
9550
      if (this_present_success || that_present_success) {
9551
        if (!(this_present_success && that_present_success))
9552
          return false;
9553
        if (!this.success.equals(that.success))
9554
          return false;
9555
      }
9556
 
9557
      boolean this_present_pex = true && this.isSetPex();
9558
      boolean that_present_pex = true && that.isSetPex();
9559
      if (this_present_pex || that_present_pex) {
9560
        if (!(this_present_pex && that_present_pex))
9561
          return false;
9562
        if (!this.pex.equals(that.pex))
9563
          return false;
9564
      }
9565
 
9566
      return true;
9567
    }
9568
 
9569
    @Override
9570
    public int hashCode() {
9571
      return 0;
9572
    }
9573
 
9574
    public int compareTo(createCoupon_result other) {
9575
      if (!getClass().equals(other.getClass())) {
9576
        return getClass().getName().compareTo(other.getClass().getName());
9577
      }
9578
 
9579
      int lastComparison = 0;
9580
      createCoupon_result typedOther = (createCoupon_result)other;
9581
 
9582
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
9583
      if (lastComparison != 0) {
9584
        return lastComparison;
9585
      }
9586
      if (isSetSuccess()) {
9587
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
9588
        if (lastComparison != 0) {
9589
          return lastComparison;
9590
        }
9591
      }
9592
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
9593
      if (lastComparison != 0) {
9594
        return lastComparison;
9595
      }
9596
      if (isSetPex()) {
9597
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
9598
        if (lastComparison != 0) {
9599
          return lastComparison;
9600
        }
9601
      }
9602
      return 0;
9603
    }
9604
 
9605
    public _Fields fieldForId(int fieldId) {
9606
      return _Fields.findByThriftId(fieldId);
9607
    }
9608
 
9609
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
9610
      org.apache.thrift.protocol.TField field;
9611
      iprot.readStructBegin();
9612
      while (true)
9613
      {
9614
        field = iprot.readFieldBegin();
9615
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
9616
          break;
9617
        }
9618
        switch (field.id) {
9619
          case 0: // SUCCESS
9620
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
9621
              this.success = iprot.readString();
9622
            } else { 
9623
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9624
            }
9625
            break;
9626
          case 1: // PEX
9627
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
9628
              this.pex = new PromotionException();
9629
              this.pex.read(iprot);
9630
            } else { 
9631
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9632
            }
9633
            break;
9634
          default:
9635
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9636
        }
9637
        iprot.readFieldEnd();
9638
      }
9639
      iprot.readStructEnd();
9640
      validate();
9641
    }
9642
 
9643
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
9644
      oprot.writeStructBegin(STRUCT_DESC);
9645
 
9646
      if (this.isSetSuccess()) {
9647
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
9648
        oprot.writeString(this.success);
9649
        oprot.writeFieldEnd();
9650
      } else if (this.isSetPex()) {
9651
        oprot.writeFieldBegin(PEX_FIELD_DESC);
9652
        this.pex.write(oprot);
9653
        oprot.writeFieldEnd();
9654
      }
9655
      oprot.writeFieldStop();
9656
      oprot.writeStructEnd();
9657
    }
9658
 
9659
    @Override
9660
    public String toString() {
9661
      StringBuilder sb = new StringBuilder("createCoupon_result(");
9662
      boolean first = true;
9663
 
9664
      sb.append("success:");
9665
      if (this.success == null) {
9666
        sb.append("null");
9667
      } else {
9668
        sb.append(this.success);
9669
      }
9670
      first = false;
9671
      if (!first) sb.append(", ");
9672
      sb.append("pex:");
9673
      if (this.pex == null) {
9674
        sb.append("null");
9675
      } else {
9676
        sb.append(this.pex);
9677
      }
9678
      first = false;
9679
      sb.append(")");
9680
      return sb.toString();
9681
    }
9682
 
9683
    public void validate() throws org.apache.thrift.TException {
9684
      // check for required fields
9685
    }
9686
 
9687
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
9688
      try {
9689
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
9690
      } catch (org.apache.thrift.TException te) {
9691
        throw new java.io.IOException(te);
9692
      }
9693
    }
9694
 
9695
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
9696
      try {
9697
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
9698
      } catch (org.apache.thrift.TException te) {
9699
        throw new java.io.IOException(te);
9700
      }
9701
    }
9702
 
9703
  }
9704
 
3430 rajveer 9705
  public static class getSuccessfulPaymentCountForCoupon_args implements org.apache.thrift.TBase<getSuccessfulPaymentCountForCoupon_args, getSuccessfulPaymentCountForCoupon_args._Fields>, java.io.Serializable, Cloneable   {
9706
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSuccessfulPaymentCountForCoupon_args");
3385 varun.gupt 9707
 
3430 rajveer 9708
    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 9709
 
3430 rajveer 9710
    private String couponCode; // required
3385 varun.gupt 9711
 
9712
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 9713
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 9714
      COUPON_CODE((short)1, "couponCode");
9715
 
9716
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
9717
 
9718
      static {
9719
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
9720
          byName.put(field.getFieldName(), field);
9721
        }
9722
      }
9723
 
9724
      /**
9725
       * Find the _Fields constant that matches fieldId, or null if its not found.
9726
       */
9727
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 9728
        switch(fieldId) {
9729
          case 1: // COUPON_CODE
9730
            return COUPON_CODE;
9731
          default:
9732
            return null;
9733
        }
3385 varun.gupt 9734
      }
9735
 
9736
      /**
9737
       * Find the _Fields constant that matches fieldId, throwing an exception
9738
       * if it is not found.
9739
       */
9740
      public static _Fields findByThriftIdOrThrow(int fieldId) {
9741
        _Fields fields = findByThriftId(fieldId);
9742
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
9743
        return fields;
9744
      }
9745
 
9746
      /**
9747
       * Find the _Fields constant that matches name, or null if its not found.
9748
       */
9749
      public static _Fields findByName(String name) {
9750
        return byName.get(name);
9751
      }
9752
 
9753
      private final short _thriftId;
9754
      private final String _fieldName;
9755
 
9756
      _Fields(short thriftId, String fieldName) {
9757
        _thriftId = thriftId;
9758
        _fieldName = fieldName;
9759
      }
9760
 
9761
      public short getThriftFieldId() {
9762
        return _thriftId;
9763
      }
9764
 
9765
      public String getFieldName() {
9766
        return _fieldName;
9767
      }
9768
    }
9769
 
9770
    // isset id assignments
9771
 
3430 rajveer 9772
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 9773
    static {
3430 rajveer 9774
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
9775
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9776
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
9777
      metaDataMap = Collections.unmodifiableMap(tmpMap);
9778
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSuccessfulPaymentCountForCoupon_args.class, metaDataMap);
3385 varun.gupt 9779
    }
9780
 
9781
    public getSuccessfulPaymentCountForCoupon_args() {
9782
    }
9783
 
9784
    public getSuccessfulPaymentCountForCoupon_args(
9785
      String couponCode)
9786
    {
9787
      this();
9788
      this.couponCode = couponCode;
9789
    }
9790
 
9791
    /**
9792
     * Performs a deep copy on <i>other</i>.
9793
     */
9794
    public getSuccessfulPaymentCountForCoupon_args(getSuccessfulPaymentCountForCoupon_args other) {
9795
      if (other.isSetCouponCode()) {
9796
        this.couponCode = other.couponCode;
9797
      }
9798
    }
9799
 
9800
    public getSuccessfulPaymentCountForCoupon_args deepCopy() {
9801
      return new getSuccessfulPaymentCountForCoupon_args(this);
9802
    }
9803
 
3430 rajveer 9804
    @Override
9805
    public void clear() {
9806
      this.couponCode = null;
3385 varun.gupt 9807
    }
9808
 
9809
    public String getCouponCode() {
9810
      return this.couponCode;
9811
    }
9812
 
3430 rajveer 9813
    public void setCouponCode(String couponCode) {
3385 varun.gupt 9814
      this.couponCode = couponCode;
9815
    }
9816
 
9817
    public void unsetCouponCode() {
9818
      this.couponCode = null;
9819
    }
9820
 
3430 rajveer 9821
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
3385 varun.gupt 9822
    public boolean isSetCouponCode() {
9823
      return this.couponCode != null;
9824
    }
9825
 
9826
    public void setCouponCodeIsSet(boolean value) {
9827
      if (!value) {
9828
        this.couponCode = null;
9829
      }
9830
    }
9831
 
9832
    public void setFieldValue(_Fields field, Object value) {
9833
      switch (field) {
9834
      case COUPON_CODE:
9835
        if (value == null) {
9836
          unsetCouponCode();
9837
        } else {
9838
          setCouponCode((String)value);
9839
        }
9840
        break;
9841
 
9842
      }
9843
    }
9844
 
9845
    public Object getFieldValue(_Fields field) {
9846
      switch (field) {
9847
      case COUPON_CODE:
9848
        return getCouponCode();
9849
 
9850
      }
9851
      throw new IllegalStateException();
9852
    }
9853
 
3430 rajveer 9854
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
9855
    public boolean isSet(_Fields field) {
9856
      if (field == null) {
9857
        throw new IllegalArgumentException();
9858
      }
3385 varun.gupt 9859
 
9860
      switch (field) {
9861
      case COUPON_CODE:
9862
        return isSetCouponCode();
9863
      }
9864
      throw new IllegalStateException();
9865
    }
9866
 
9867
    @Override
9868
    public boolean equals(Object that) {
9869
      if (that == null)
9870
        return false;
9871
      if (that instanceof getSuccessfulPaymentCountForCoupon_args)
9872
        return this.equals((getSuccessfulPaymentCountForCoupon_args)that);
9873
      return false;
9874
    }
9875
 
9876
    public boolean equals(getSuccessfulPaymentCountForCoupon_args that) {
9877
      if (that == null)
9878
        return false;
9879
 
9880
      boolean this_present_couponCode = true && this.isSetCouponCode();
9881
      boolean that_present_couponCode = true && that.isSetCouponCode();
9882
      if (this_present_couponCode || that_present_couponCode) {
9883
        if (!(this_present_couponCode && that_present_couponCode))
9884
          return false;
9885
        if (!this.couponCode.equals(that.couponCode))
9886
          return false;
9887
      }
9888
 
9889
      return true;
9890
    }
9891
 
9892
    @Override
9893
    public int hashCode() {
9894
      return 0;
9895
    }
9896
 
9897
    public int compareTo(getSuccessfulPaymentCountForCoupon_args other) {
9898
      if (!getClass().equals(other.getClass())) {
9899
        return getClass().getName().compareTo(other.getClass().getName());
9900
      }
9901
 
9902
      int lastComparison = 0;
9903
      getSuccessfulPaymentCountForCoupon_args typedOther = (getSuccessfulPaymentCountForCoupon_args)other;
9904
 
3430 rajveer 9905
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
3385 varun.gupt 9906
      if (lastComparison != 0) {
9907
        return lastComparison;
9908
      }
3430 rajveer 9909
      if (isSetCouponCode()) {
9910
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
9911
        if (lastComparison != 0) {
9912
          return lastComparison;
9913
        }
3385 varun.gupt 9914
      }
9915
      return 0;
9916
    }
9917
 
3430 rajveer 9918
    public _Fields fieldForId(int fieldId) {
9919
      return _Fields.findByThriftId(fieldId);
9920
    }
9921
 
9922
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
9923
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 9924
      iprot.readStructBegin();
9925
      while (true)
9926
      {
9927
        field = iprot.readFieldBegin();
3430 rajveer 9928
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 9929
          break;
9930
        }
3430 rajveer 9931
        switch (field.id) {
9932
          case 1: // COUPON_CODE
9933
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
9934
              this.couponCode = iprot.readString();
9935
            } else { 
9936
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9937
            }
9938
            break;
9939
          default:
9940
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 9941
        }
3430 rajveer 9942
        iprot.readFieldEnd();
3385 varun.gupt 9943
      }
9944
      iprot.readStructEnd();
9945
      validate();
9946
    }
9947
 
3430 rajveer 9948
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 9949
      validate();
9950
 
9951
      oprot.writeStructBegin(STRUCT_DESC);
9952
      if (this.couponCode != null) {
9953
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
9954
        oprot.writeString(this.couponCode);
9955
        oprot.writeFieldEnd();
9956
      }
9957
      oprot.writeFieldStop();
9958
      oprot.writeStructEnd();
9959
    }
9960
 
9961
    @Override
9962
    public String toString() {
9963
      StringBuilder sb = new StringBuilder("getSuccessfulPaymentCountForCoupon_args(");
9964
      boolean first = true;
9965
 
9966
      sb.append("couponCode:");
9967
      if (this.couponCode == null) {
9968
        sb.append("null");
9969
      } else {
9970
        sb.append(this.couponCode);
9971
      }
9972
      first = false;
9973
      sb.append(")");
9974
      return sb.toString();
9975
    }
9976
 
3430 rajveer 9977
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 9978
      // check for required fields
9979
    }
9980
 
3430 rajveer 9981
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
9982
      try {
9983
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
9984
      } catch (org.apache.thrift.TException te) {
9985
        throw new java.io.IOException(te);
9986
      }
9987
    }
9988
 
9989
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
9990
      try {
9991
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
9992
      } catch (org.apache.thrift.TException te) {
9993
        throw new java.io.IOException(te);
9994
      }
9995
    }
9996
 
3385 varun.gupt 9997
  }
9998
 
3430 rajveer 9999
  public static class getSuccessfulPaymentCountForCoupon_result implements org.apache.thrift.TBase<getSuccessfulPaymentCountForCoupon_result, getSuccessfulPaymentCountForCoupon_result._Fields>, java.io.Serializable, Cloneable   {
10000
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSuccessfulPaymentCountForCoupon_result");
3385 varun.gupt 10001
 
3430 rajveer 10002
    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);
10003
    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 10004
 
3430 rajveer 10005
    private long success; // required
10006
    private PromotionException pex; // required
3385 varun.gupt 10007
 
10008
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 10009
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 10010
      SUCCESS((short)0, "success"),
10011
      PEX((short)1, "pex");
10012
 
10013
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
10014
 
10015
      static {
10016
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
10017
          byName.put(field.getFieldName(), field);
10018
        }
10019
      }
10020
 
10021
      /**
10022
       * Find the _Fields constant that matches fieldId, or null if its not found.
10023
       */
10024
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 10025
        switch(fieldId) {
10026
          case 0: // SUCCESS
10027
            return SUCCESS;
10028
          case 1: // PEX
10029
            return PEX;
10030
          default:
10031
            return null;
10032
        }
3385 varun.gupt 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
 
10069
    // isset id assignments
10070
    private static final int __SUCCESS_ISSET_ID = 0;
10071
    private BitSet __isset_bit_vector = new BitSet(1);
10072
 
3430 rajveer 10073
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 10074
    static {
3430 rajveer 10075
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
10076
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10077
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
10078
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10079
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
10080
      metaDataMap = Collections.unmodifiableMap(tmpMap);
10081
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSuccessfulPaymentCountForCoupon_result.class, metaDataMap);
3385 varun.gupt 10082
    }
10083
 
10084
    public getSuccessfulPaymentCountForCoupon_result() {
10085
    }
10086
 
10087
    public getSuccessfulPaymentCountForCoupon_result(
10088
      long success,
10089
      PromotionException pex)
10090
    {
10091
      this();
10092
      this.success = success;
10093
      setSuccessIsSet(true);
10094
      this.pex = pex;
10095
    }
10096
 
10097
    /**
10098
     * Performs a deep copy on <i>other</i>.
10099
     */
10100
    public getSuccessfulPaymentCountForCoupon_result(getSuccessfulPaymentCountForCoupon_result other) {
10101
      __isset_bit_vector.clear();
10102
      __isset_bit_vector.or(other.__isset_bit_vector);
10103
      this.success = other.success;
10104
      if (other.isSetPex()) {
10105
        this.pex = new PromotionException(other.pex);
10106
      }
10107
    }
10108
 
10109
    public getSuccessfulPaymentCountForCoupon_result deepCopy() {
10110
      return new getSuccessfulPaymentCountForCoupon_result(this);
10111
    }
10112
 
3430 rajveer 10113
    @Override
10114
    public void clear() {
10115
      setSuccessIsSet(false);
10116
      this.success = 0;
10117
      this.pex = null;
3385 varun.gupt 10118
    }
10119
 
10120
    public long getSuccess() {
10121
      return this.success;
10122
    }
10123
 
3430 rajveer 10124
    public void setSuccess(long success) {
3385 varun.gupt 10125
      this.success = success;
10126
      setSuccessIsSet(true);
10127
    }
10128
 
10129
    public void unsetSuccess() {
10130
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
10131
    }
10132
 
3430 rajveer 10133
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3385 varun.gupt 10134
    public boolean isSetSuccess() {
10135
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
10136
    }
10137
 
10138
    public void setSuccessIsSet(boolean value) {
10139
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
10140
    }
10141
 
10142
    public PromotionException getPex() {
10143
      return this.pex;
10144
    }
10145
 
3430 rajveer 10146
    public void setPex(PromotionException pex) {
3385 varun.gupt 10147
      this.pex = pex;
10148
    }
10149
 
10150
    public void unsetPex() {
10151
      this.pex = null;
10152
    }
10153
 
3430 rajveer 10154
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
3385 varun.gupt 10155
    public boolean isSetPex() {
10156
      return this.pex != null;
10157
    }
10158
 
10159
    public void setPexIsSet(boolean value) {
10160
      if (!value) {
10161
        this.pex = null;
10162
      }
10163
    }
10164
 
10165
    public void setFieldValue(_Fields field, Object value) {
10166
      switch (field) {
10167
      case SUCCESS:
10168
        if (value == null) {
10169
          unsetSuccess();
10170
        } else {
10171
          setSuccess((Long)value);
10172
        }
10173
        break;
10174
 
10175
      case PEX:
10176
        if (value == null) {
10177
          unsetPex();
10178
        } else {
10179
          setPex((PromotionException)value);
10180
        }
10181
        break;
10182
 
10183
      }
10184
    }
10185
 
10186
    public Object getFieldValue(_Fields field) {
10187
      switch (field) {
10188
      case SUCCESS:
3430 rajveer 10189
        return Long.valueOf(getSuccess());
3385 varun.gupt 10190
 
10191
      case PEX:
10192
        return getPex();
10193
 
10194
      }
10195
      throw new IllegalStateException();
10196
    }
10197
 
3430 rajveer 10198
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
10199
    public boolean isSet(_Fields field) {
10200
      if (field == null) {
10201
        throw new IllegalArgumentException();
10202
      }
3385 varun.gupt 10203
 
10204
      switch (field) {
10205
      case SUCCESS:
10206
        return isSetSuccess();
10207
      case PEX:
10208
        return isSetPex();
10209
      }
10210
      throw new IllegalStateException();
10211
    }
10212
 
10213
    @Override
10214
    public boolean equals(Object that) {
10215
      if (that == null)
10216
        return false;
10217
      if (that instanceof getSuccessfulPaymentCountForCoupon_result)
10218
        return this.equals((getSuccessfulPaymentCountForCoupon_result)that);
10219
      return false;
10220
    }
10221
 
10222
    public boolean equals(getSuccessfulPaymentCountForCoupon_result that) {
10223
      if (that == null)
10224
        return false;
10225
 
10226
      boolean this_present_success = true;
10227
      boolean that_present_success = true;
10228
      if (this_present_success || that_present_success) {
10229
        if (!(this_present_success && that_present_success))
10230
          return false;
10231
        if (this.success != that.success)
10232
          return false;
10233
      }
10234
 
10235
      boolean this_present_pex = true && this.isSetPex();
10236
      boolean that_present_pex = true && that.isSetPex();
10237
      if (this_present_pex || that_present_pex) {
10238
        if (!(this_present_pex && that_present_pex))
10239
          return false;
10240
        if (!this.pex.equals(that.pex))
10241
          return false;
10242
      }
10243
 
10244
      return true;
10245
    }
10246
 
10247
    @Override
10248
    public int hashCode() {
10249
      return 0;
10250
    }
10251
 
10252
    public int compareTo(getSuccessfulPaymentCountForCoupon_result other) {
10253
      if (!getClass().equals(other.getClass())) {
10254
        return getClass().getName().compareTo(other.getClass().getName());
10255
      }
10256
 
10257
      int lastComparison = 0;
10258
      getSuccessfulPaymentCountForCoupon_result typedOther = (getSuccessfulPaymentCountForCoupon_result)other;
10259
 
3430 rajveer 10260
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3385 varun.gupt 10261
      if (lastComparison != 0) {
10262
        return lastComparison;
10263
      }
3430 rajveer 10264
      if (isSetSuccess()) {
10265
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
10266
        if (lastComparison != 0) {
10267
          return lastComparison;
10268
        }
3385 varun.gupt 10269
      }
3430 rajveer 10270
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
3385 varun.gupt 10271
      if (lastComparison != 0) {
10272
        return lastComparison;
10273
      }
3430 rajveer 10274
      if (isSetPex()) {
10275
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
10276
        if (lastComparison != 0) {
10277
          return lastComparison;
10278
        }
3385 varun.gupt 10279
      }
10280
      return 0;
10281
    }
10282
 
3430 rajveer 10283
    public _Fields fieldForId(int fieldId) {
10284
      return _Fields.findByThriftId(fieldId);
10285
    }
10286
 
10287
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
10288
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 10289
      iprot.readStructBegin();
10290
      while (true)
10291
      {
10292
        field = iprot.readFieldBegin();
3430 rajveer 10293
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 10294
          break;
10295
        }
3430 rajveer 10296
        switch (field.id) {
10297
          case 0: // SUCCESS
10298
            if (field.type == org.apache.thrift.protocol.TType.I64) {
10299
              this.success = iprot.readI64();
10300
              setSuccessIsSet(true);
10301
            } else { 
10302
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10303
            }
10304
            break;
10305
          case 1: // PEX
10306
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
10307
              this.pex = new PromotionException();
10308
              this.pex.read(iprot);
10309
            } else { 
10310
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10311
            }
10312
            break;
10313
          default:
10314
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 10315
        }
3430 rajveer 10316
        iprot.readFieldEnd();
3385 varun.gupt 10317
      }
10318
      iprot.readStructEnd();
10319
      validate();
10320
    }
10321
 
3430 rajveer 10322
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 10323
      oprot.writeStructBegin(STRUCT_DESC);
10324
 
10325
      if (this.isSetSuccess()) {
10326
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
10327
        oprot.writeI64(this.success);
10328
        oprot.writeFieldEnd();
10329
      } else if (this.isSetPex()) {
10330
        oprot.writeFieldBegin(PEX_FIELD_DESC);
10331
        this.pex.write(oprot);
10332
        oprot.writeFieldEnd();
10333
      }
10334
      oprot.writeFieldStop();
10335
      oprot.writeStructEnd();
10336
    }
10337
 
10338
    @Override
10339
    public String toString() {
10340
      StringBuilder sb = new StringBuilder("getSuccessfulPaymentCountForCoupon_result(");
10341
      boolean first = true;
10342
 
10343
      sb.append("success:");
10344
      sb.append(this.success);
10345
      first = false;
10346
      if (!first) sb.append(", ");
10347
      sb.append("pex:");
10348
      if (this.pex == null) {
10349
        sb.append("null");
10350
      } else {
10351
        sb.append(this.pex);
10352
      }
10353
      first = false;
10354
      sb.append(")");
10355
      return sb.toString();
10356
    }
10357
 
3430 rajveer 10358
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 10359
      // check for required fields
10360
    }
10361
 
3430 rajveer 10362
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
10363
      try {
10364
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
10365
      } catch (org.apache.thrift.TException te) {
10366
        throw new java.io.IOException(te);
10367
      }
10368
    }
10369
 
10370
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
10371
      try {
10372
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
10373
      } catch (org.apache.thrift.TException te) {
10374
        throw new java.io.IOException(te);
10375
      }
10376
    }
10377
 
3385 varun.gupt 10378
  }
10379
 
3430 rajveer 10380
  public static class getRuleDocString_args implements org.apache.thrift.TBase<getRuleDocString_args, getRuleDocString_args._Fields>, java.io.Serializable, Cloneable   {
10381
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRuleDocString_args");
3385 varun.gupt 10382
 
3430 rajveer 10383
    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 10384
 
3430 rajveer 10385
    private String ruleName; // required
3385 varun.gupt 10386
 
10387
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 10388
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 10389
      RULE_NAME((short)1, "ruleName");
10390
 
10391
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
10392
 
10393
      static {
10394
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
10395
          byName.put(field.getFieldName(), field);
10396
        }
10397
      }
10398
 
10399
      /**
10400
       * Find the _Fields constant that matches fieldId, or null if its not found.
10401
       */
10402
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 10403
        switch(fieldId) {
10404
          case 1: // RULE_NAME
10405
            return RULE_NAME;
10406
          default:
10407
            return null;
10408
        }
3385 varun.gupt 10409
      }
10410
 
10411
      /**
10412
       * Find the _Fields constant that matches fieldId, throwing an exception
10413
       * if it is not found.
10414
       */
10415
      public static _Fields findByThriftIdOrThrow(int fieldId) {
10416
        _Fields fields = findByThriftId(fieldId);
10417
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
10418
        return fields;
10419
      }
10420
 
10421
      /**
10422
       * Find the _Fields constant that matches name, or null if its not found.
10423
       */
10424
      public static _Fields findByName(String name) {
10425
        return byName.get(name);
10426
      }
10427
 
10428
      private final short _thriftId;
10429
      private final String _fieldName;
10430
 
10431
      _Fields(short thriftId, String fieldName) {
10432
        _thriftId = thriftId;
10433
        _fieldName = fieldName;
10434
      }
10435
 
10436
      public short getThriftFieldId() {
10437
        return _thriftId;
10438
      }
10439
 
10440
      public String getFieldName() {
10441
        return _fieldName;
10442
      }
10443
    }
10444
 
10445
    // isset id assignments
10446
 
3430 rajveer 10447
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 10448
    static {
3430 rajveer 10449
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
10450
      tmpMap.put(_Fields.RULE_NAME, new org.apache.thrift.meta_data.FieldMetaData("ruleName", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10451
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
10452
      metaDataMap = Collections.unmodifiableMap(tmpMap);
10453
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRuleDocString_args.class, metaDataMap);
3385 varun.gupt 10454
    }
10455
 
10456
    public getRuleDocString_args() {
10457
    }
10458
 
10459
    public getRuleDocString_args(
10460
      String ruleName)
10461
    {
10462
      this();
10463
      this.ruleName = ruleName;
10464
    }
10465
 
10466
    /**
10467
     * Performs a deep copy on <i>other</i>.
10468
     */
10469
    public getRuleDocString_args(getRuleDocString_args other) {
10470
      if (other.isSetRuleName()) {
10471
        this.ruleName = other.ruleName;
10472
      }
10473
    }
10474
 
10475
    public getRuleDocString_args deepCopy() {
10476
      return new getRuleDocString_args(this);
10477
    }
10478
 
3430 rajveer 10479
    @Override
10480
    public void clear() {
10481
      this.ruleName = null;
3385 varun.gupt 10482
    }
10483
 
10484
    public String getRuleName() {
10485
      return this.ruleName;
10486
    }
10487
 
3430 rajveer 10488
    public void setRuleName(String ruleName) {
3385 varun.gupt 10489
      this.ruleName = ruleName;
10490
    }
10491
 
10492
    public void unsetRuleName() {
10493
      this.ruleName = null;
10494
    }
10495
 
3430 rajveer 10496
    /** Returns true if field ruleName is set (has been assigned a value) and false otherwise */
3385 varun.gupt 10497
    public boolean isSetRuleName() {
10498
      return this.ruleName != null;
10499
    }
10500
 
10501
    public void setRuleNameIsSet(boolean value) {
10502
      if (!value) {
10503
        this.ruleName = null;
10504
      }
10505
    }
10506
 
10507
    public void setFieldValue(_Fields field, Object value) {
10508
      switch (field) {
10509
      case RULE_NAME:
10510
        if (value == null) {
10511
          unsetRuleName();
10512
        } else {
10513
          setRuleName((String)value);
10514
        }
10515
        break;
10516
 
10517
      }
10518
    }
10519
 
10520
    public Object getFieldValue(_Fields field) {
10521
      switch (field) {
10522
      case RULE_NAME:
10523
        return getRuleName();
10524
 
10525
      }
10526
      throw new IllegalStateException();
10527
    }
10528
 
3430 rajveer 10529
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
10530
    public boolean isSet(_Fields field) {
10531
      if (field == null) {
10532
        throw new IllegalArgumentException();
10533
      }
3385 varun.gupt 10534
 
10535
      switch (field) {
10536
      case RULE_NAME:
10537
        return isSetRuleName();
10538
      }
10539
      throw new IllegalStateException();
10540
    }
10541
 
10542
    @Override
10543
    public boolean equals(Object that) {
10544
      if (that == null)
10545
        return false;
10546
      if (that instanceof getRuleDocString_args)
10547
        return this.equals((getRuleDocString_args)that);
10548
      return false;
10549
    }
10550
 
10551
    public boolean equals(getRuleDocString_args that) {
10552
      if (that == null)
10553
        return false;
10554
 
10555
      boolean this_present_ruleName = true && this.isSetRuleName();
10556
      boolean that_present_ruleName = true && that.isSetRuleName();
10557
      if (this_present_ruleName || that_present_ruleName) {
10558
        if (!(this_present_ruleName && that_present_ruleName))
10559
          return false;
10560
        if (!this.ruleName.equals(that.ruleName))
10561
          return false;
10562
      }
10563
 
10564
      return true;
10565
    }
10566
 
10567
    @Override
10568
    public int hashCode() {
10569
      return 0;
10570
    }
10571
 
10572
    public int compareTo(getRuleDocString_args other) {
10573
      if (!getClass().equals(other.getClass())) {
10574
        return getClass().getName().compareTo(other.getClass().getName());
10575
      }
10576
 
10577
      int lastComparison = 0;
10578
      getRuleDocString_args typedOther = (getRuleDocString_args)other;
10579
 
3430 rajveer 10580
      lastComparison = Boolean.valueOf(isSetRuleName()).compareTo(typedOther.isSetRuleName());
3385 varun.gupt 10581
      if (lastComparison != 0) {
10582
        return lastComparison;
10583
      }
3430 rajveer 10584
      if (isSetRuleName()) {
10585
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ruleName, typedOther.ruleName);
10586
        if (lastComparison != 0) {
10587
          return lastComparison;
10588
        }
3385 varun.gupt 10589
      }
10590
      return 0;
10591
    }
10592
 
3430 rajveer 10593
    public _Fields fieldForId(int fieldId) {
10594
      return _Fields.findByThriftId(fieldId);
10595
    }
10596
 
10597
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
10598
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 10599
      iprot.readStructBegin();
10600
      while (true)
10601
      {
10602
        field = iprot.readFieldBegin();
3430 rajveer 10603
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 10604
          break;
10605
        }
3430 rajveer 10606
        switch (field.id) {
10607
          case 1: // RULE_NAME
10608
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
10609
              this.ruleName = iprot.readString();
10610
            } else { 
10611
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10612
            }
10613
            break;
10614
          default:
10615
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 10616
        }
3430 rajveer 10617
        iprot.readFieldEnd();
3385 varun.gupt 10618
      }
10619
      iprot.readStructEnd();
10620
      validate();
10621
    }
10622
 
3430 rajveer 10623
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 10624
      validate();
10625
 
10626
      oprot.writeStructBegin(STRUCT_DESC);
10627
      if (this.ruleName != null) {
10628
        oprot.writeFieldBegin(RULE_NAME_FIELD_DESC);
10629
        oprot.writeString(this.ruleName);
10630
        oprot.writeFieldEnd();
10631
      }
10632
      oprot.writeFieldStop();
10633
      oprot.writeStructEnd();
10634
    }
10635
 
10636
    @Override
10637
    public String toString() {
10638
      StringBuilder sb = new StringBuilder("getRuleDocString_args(");
10639
      boolean first = true;
10640
 
10641
      sb.append("ruleName:");
10642
      if (this.ruleName == null) {
10643
        sb.append("null");
10644
      } else {
10645
        sb.append(this.ruleName);
10646
      }
10647
      first = false;
10648
      sb.append(")");
10649
      return sb.toString();
10650
    }
10651
 
3430 rajveer 10652
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 10653
      // check for required fields
10654
    }
10655
 
3430 rajveer 10656
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
10657
      try {
10658
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
10659
      } catch (org.apache.thrift.TException te) {
10660
        throw new java.io.IOException(te);
10661
      }
10662
    }
10663
 
10664
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
10665
      try {
10666
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
10667
      } catch (org.apache.thrift.TException te) {
10668
        throw new java.io.IOException(te);
10669
      }
10670
    }
10671
 
3385 varun.gupt 10672
  }
10673
 
3430 rajveer 10674
  public static class getRuleDocString_result implements org.apache.thrift.TBase<getRuleDocString_result, getRuleDocString_result._Fields>, java.io.Serializable, Cloneable   {
10675
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRuleDocString_result");
3385 varun.gupt 10676
 
3430 rajveer 10677
    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 10678
 
3430 rajveer 10679
    private String success; // required
3385 varun.gupt 10680
 
10681
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 10682
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 10683
      SUCCESS((short)0, "success");
10684
 
10685
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
10686
 
10687
      static {
10688
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
10689
          byName.put(field.getFieldName(), field);
10690
        }
10691
      }
10692
 
10693
      /**
10694
       * Find the _Fields constant that matches fieldId, or null if its not found.
10695
       */
10696
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 10697
        switch(fieldId) {
10698
          case 0: // SUCCESS
10699
            return SUCCESS;
10700
          default:
10701
            return null;
10702
        }
3385 varun.gupt 10703
      }
10704
 
10705
      /**
10706
       * Find the _Fields constant that matches fieldId, throwing an exception
10707
       * if it is not found.
10708
       */
10709
      public static _Fields findByThriftIdOrThrow(int fieldId) {
10710
        _Fields fields = findByThriftId(fieldId);
10711
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
10712
        return fields;
10713
      }
10714
 
10715
      /**
10716
       * Find the _Fields constant that matches name, or null if its not found.
10717
       */
10718
      public static _Fields findByName(String name) {
10719
        return byName.get(name);
10720
      }
10721
 
10722
      private final short _thriftId;
10723
      private final String _fieldName;
10724
 
10725
      _Fields(short thriftId, String fieldName) {
10726
        _thriftId = thriftId;
10727
        _fieldName = fieldName;
10728
      }
10729
 
10730
      public short getThriftFieldId() {
10731
        return _thriftId;
10732
      }
10733
 
10734
      public String getFieldName() {
10735
        return _fieldName;
10736
      }
10737
    }
10738
 
10739
    // isset id assignments
10740
 
3430 rajveer 10741
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 10742
    static {
3430 rajveer 10743
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
10744
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10745
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
10746
      metaDataMap = Collections.unmodifiableMap(tmpMap);
10747
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRuleDocString_result.class, metaDataMap);
3385 varun.gupt 10748
    }
10749
 
10750
    public getRuleDocString_result() {
10751
    }
10752
 
10753
    public getRuleDocString_result(
10754
      String success)
10755
    {
10756
      this();
10757
      this.success = success;
10758
    }
10759
 
10760
    /**
10761
     * Performs a deep copy on <i>other</i>.
10762
     */
10763
    public getRuleDocString_result(getRuleDocString_result other) {
10764
      if (other.isSetSuccess()) {
10765
        this.success = other.success;
10766
      }
10767
    }
10768
 
10769
    public getRuleDocString_result deepCopy() {
10770
      return new getRuleDocString_result(this);
10771
    }
10772
 
3430 rajveer 10773
    @Override
10774
    public void clear() {
10775
      this.success = null;
3385 varun.gupt 10776
    }
10777
 
10778
    public String getSuccess() {
10779
      return this.success;
10780
    }
10781
 
3430 rajveer 10782
    public void setSuccess(String success) {
3385 varun.gupt 10783
      this.success = success;
10784
    }
10785
 
10786
    public void unsetSuccess() {
10787
      this.success = null;
10788
    }
10789
 
3430 rajveer 10790
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3385 varun.gupt 10791
    public boolean isSetSuccess() {
10792
      return this.success != null;
10793
    }
10794
 
10795
    public void setSuccessIsSet(boolean value) {
10796
      if (!value) {
10797
        this.success = null;
10798
      }
10799
    }
10800
 
10801
    public void setFieldValue(_Fields field, Object value) {
10802
      switch (field) {
10803
      case SUCCESS:
10804
        if (value == null) {
10805
          unsetSuccess();
10806
        } else {
10807
          setSuccess((String)value);
10808
        }
10809
        break;
10810
 
10811
      }
10812
    }
10813
 
10814
    public Object getFieldValue(_Fields field) {
10815
      switch (field) {
10816
      case SUCCESS:
10817
        return getSuccess();
10818
 
10819
      }
10820
      throw new IllegalStateException();
10821
    }
10822
 
3430 rajveer 10823
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
10824
    public boolean isSet(_Fields field) {
10825
      if (field == null) {
10826
        throw new IllegalArgumentException();
10827
      }
3385 varun.gupt 10828
 
10829
      switch (field) {
10830
      case SUCCESS:
10831
        return isSetSuccess();
10832
      }
10833
      throw new IllegalStateException();
10834
    }
10835
 
10836
    @Override
10837
    public boolean equals(Object that) {
10838
      if (that == null)
10839
        return false;
10840
      if (that instanceof getRuleDocString_result)
10841
        return this.equals((getRuleDocString_result)that);
10842
      return false;
10843
    }
10844
 
10845
    public boolean equals(getRuleDocString_result that) {
10846
      if (that == null)
10847
        return false;
10848
 
10849
      boolean this_present_success = true && this.isSetSuccess();
10850
      boolean that_present_success = true && that.isSetSuccess();
10851
      if (this_present_success || that_present_success) {
10852
        if (!(this_present_success && that_present_success))
10853
          return false;
10854
        if (!this.success.equals(that.success))
10855
          return false;
10856
      }
10857
 
10858
      return true;
10859
    }
10860
 
10861
    @Override
10862
    public int hashCode() {
10863
      return 0;
10864
    }
10865
 
10866
    public int compareTo(getRuleDocString_result other) {
10867
      if (!getClass().equals(other.getClass())) {
10868
        return getClass().getName().compareTo(other.getClass().getName());
10869
      }
10870
 
10871
      int lastComparison = 0;
10872
      getRuleDocString_result typedOther = (getRuleDocString_result)other;
10873
 
3430 rajveer 10874
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3385 varun.gupt 10875
      if (lastComparison != 0) {
10876
        return lastComparison;
10877
      }
3430 rajveer 10878
      if (isSetSuccess()) {
10879
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
10880
        if (lastComparison != 0) {
10881
          return lastComparison;
10882
        }
3385 varun.gupt 10883
      }
10884
      return 0;
10885
    }
10886
 
3430 rajveer 10887
    public _Fields fieldForId(int fieldId) {
10888
      return _Fields.findByThriftId(fieldId);
10889
    }
10890
 
10891
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
10892
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 10893
      iprot.readStructBegin();
10894
      while (true)
10895
      {
10896
        field = iprot.readFieldBegin();
3430 rajveer 10897
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 10898
          break;
10899
        }
3430 rajveer 10900
        switch (field.id) {
10901
          case 0: // SUCCESS
10902
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
10903
              this.success = iprot.readString();
10904
            } else { 
10905
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10906
            }
10907
            break;
10908
          default:
10909
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 10910
        }
3430 rajveer 10911
        iprot.readFieldEnd();
3385 varun.gupt 10912
      }
10913
      iprot.readStructEnd();
10914
      validate();
10915
    }
10916
 
3430 rajveer 10917
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 10918
      oprot.writeStructBegin(STRUCT_DESC);
10919
 
10920
      if (this.isSetSuccess()) {
10921
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
10922
        oprot.writeString(this.success);
10923
        oprot.writeFieldEnd();
10924
      }
10925
      oprot.writeFieldStop();
10926
      oprot.writeStructEnd();
10927
    }
10928
 
10929
    @Override
10930
    public String toString() {
10931
      StringBuilder sb = new StringBuilder("getRuleDocString_result(");
10932
      boolean first = true;
10933
 
10934
      sb.append("success:");
10935
      if (this.success == null) {
10936
        sb.append("null");
10937
      } else {
10938
        sb.append(this.success);
10939
      }
10940
      first = false;
10941
      sb.append(")");
10942
      return sb.toString();
10943
    }
10944
 
3430 rajveer 10945
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 10946
      // check for required fields
10947
    }
10948
 
3430 rajveer 10949
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
10950
      try {
10951
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
10952
      } catch (org.apache.thrift.TException te) {
10953
        throw new java.io.IOException(te);
10954
      }
10955
    }
10956
 
10957
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
10958
      try {
10959
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
10960
      } catch (org.apache.thrift.TException te) {
10961
        throw new java.io.IOException(te);
10962
      }
10963
    }
10964
 
3385 varun.gupt 10965
  }
10966
 
4189 varun.gupt 10967
  public static class getItemDiscountMap_args implements org.apache.thrift.TBase<getItemDiscountMap_args, getItemDiscountMap_args._Fields>, java.io.Serializable, Cloneable   {
10968
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemDiscountMap_args");
10969
 
10970
    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);
10971
 
10972
    private List<Long> itemIds; // required
10973
 
10974
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
10975
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
10976
      ITEM_IDS((short)1, "itemIds");
10977
 
10978
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
10979
 
10980
      static {
10981
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
10982
          byName.put(field.getFieldName(), field);
10983
        }
10984
      }
10985
 
10986
      /**
10987
       * Find the _Fields constant that matches fieldId, or null if its not found.
10988
       */
10989
      public static _Fields findByThriftId(int fieldId) {
10990
        switch(fieldId) {
10991
          case 1: // ITEM_IDS
10992
            return ITEM_IDS;
10993
          default:
10994
            return null;
10995
        }
10996
      }
10997
 
10998
      /**
10999
       * Find the _Fields constant that matches fieldId, throwing an exception
11000
       * if it is not found.
11001
       */
11002
      public static _Fields findByThriftIdOrThrow(int fieldId) {
11003
        _Fields fields = findByThriftId(fieldId);
11004
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
11005
        return fields;
11006
      }
11007
 
11008
      /**
11009
       * Find the _Fields constant that matches name, or null if its not found.
11010
       */
11011
      public static _Fields findByName(String name) {
11012
        return byName.get(name);
11013
      }
11014
 
11015
      private final short _thriftId;
11016
      private final String _fieldName;
11017
 
11018
      _Fields(short thriftId, String fieldName) {
11019
        _thriftId = thriftId;
11020
        _fieldName = fieldName;
11021
      }
11022
 
11023
      public short getThriftFieldId() {
11024
        return _thriftId;
11025
      }
11026
 
11027
      public String getFieldName() {
11028
        return _fieldName;
11029
      }
11030
    }
11031
 
11032
    // isset id assignments
11033
 
11034
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
11035
    static {
11036
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
11037
      tmpMap.put(_Fields.ITEM_IDS, new org.apache.thrift.meta_data.FieldMetaData("itemIds", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11038
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
11039
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))));
11040
      metaDataMap = Collections.unmodifiableMap(tmpMap);
11041
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getItemDiscountMap_args.class, metaDataMap);
11042
    }
11043
 
11044
    public getItemDiscountMap_args() {
11045
    }
11046
 
11047
    public getItemDiscountMap_args(
11048
      List<Long> itemIds)
11049
    {
11050
      this();
11051
      this.itemIds = itemIds;
11052
    }
11053
 
11054
    /**
11055
     * Performs a deep copy on <i>other</i>.
11056
     */
11057
    public getItemDiscountMap_args(getItemDiscountMap_args other) {
11058
      if (other.isSetItemIds()) {
11059
        List<Long> __this__itemIds = new ArrayList<Long>();
11060
        for (Long other_element : other.itemIds) {
11061
          __this__itemIds.add(other_element);
11062
        }
11063
        this.itemIds = __this__itemIds;
11064
      }
11065
    }
11066
 
11067
    public getItemDiscountMap_args deepCopy() {
11068
      return new getItemDiscountMap_args(this);
11069
    }
11070
 
11071
    @Override
11072
    public void clear() {
11073
      this.itemIds = null;
11074
    }
11075
 
11076
    public int getItemIdsSize() {
11077
      return (this.itemIds == null) ? 0 : this.itemIds.size();
11078
    }
11079
 
11080
    public java.util.Iterator<Long> getItemIdsIterator() {
11081
      return (this.itemIds == null) ? null : this.itemIds.iterator();
11082
    }
11083
 
11084
    public void addToItemIds(long elem) {
11085
      if (this.itemIds == null) {
11086
        this.itemIds = new ArrayList<Long>();
11087
      }
11088
      this.itemIds.add(elem);
11089
    }
11090
 
11091
    public List<Long> getItemIds() {
11092
      return this.itemIds;
11093
    }
11094
 
11095
    public void setItemIds(List<Long> itemIds) {
11096
      this.itemIds = itemIds;
11097
    }
11098
 
11099
    public void unsetItemIds() {
11100
      this.itemIds = null;
11101
    }
11102
 
11103
    /** Returns true if field itemIds is set (has been assigned a value) and false otherwise */
11104
    public boolean isSetItemIds() {
11105
      return this.itemIds != null;
11106
    }
11107
 
11108
    public void setItemIdsIsSet(boolean value) {
11109
      if (!value) {
11110
        this.itemIds = null;
11111
      }
11112
    }
11113
 
11114
    public void setFieldValue(_Fields field, Object value) {
11115
      switch (field) {
11116
      case ITEM_IDS:
11117
        if (value == null) {
11118
          unsetItemIds();
11119
        } else {
11120
          setItemIds((List<Long>)value);
11121
        }
11122
        break;
11123
 
11124
      }
11125
    }
11126
 
11127
    public Object getFieldValue(_Fields field) {
11128
      switch (field) {
11129
      case ITEM_IDS:
11130
        return getItemIds();
11131
 
11132
      }
11133
      throw new IllegalStateException();
11134
    }
11135
 
11136
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
11137
    public boolean isSet(_Fields field) {
11138
      if (field == null) {
11139
        throw new IllegalArgumentException();
11140
      }
11141
 
11142
      switch (field) {
11143
      case ITEM_IDS:
11144
        return isSetItemIds();
11145
      }
11146
      throw new IllegalStateException();
11147
    }
11148
 
11149
    @Override
11150
    public boolean equals(Object that) {
11151
      if (that == null)
11152
        return false;
11153
      if (that instanceof getItemDiscountMap_args)
11154
        return this.equals((getItemDiscountMap_args)that);
11155
      return false;
11156
    }
11157
 
11158
    public boolean equals(getItemDiscountMap_args that) {
11159
      if (that == null)
11160
        return false;
11161
 
11162
      boolean this_present_itemIds = true && this.isSetItemIds();
11163
      boolean that_present_itemIds = true && that.isSetItemIds();
11164
      if (this_present_itemIds || that_present_itemIds) {
11165
        if (!(this_present_itemIds && that_present_itemIds))
11166
          return false;
11167
        if (!this.itemIds.equals(that.itemIds))
11168
          return false;
11169
      }
11170
 
11171
      return true;
11172
    }
11173
 
11174
    @Override
11175
    public int hashCode() {
11176
      return 0;
11177
    }
11178
 
11179
    public int compareTo(getItemDiscountMap_args other) {
11180
      if (!getClass().equals(other.getClass())) {
11181
        return getClass().getName().compareTo(other.getClass().getName());
11182
      }
11183
 
11184
      int lastComparison = 0;
11185
      getItemDiscountMap_args typedOther = (getItemDiscountMap_args)other;
11186
 
11187
      lastComparison = Boolean.valueOf(isSetItemIds()).compareTo(typedOther.isSetItemIds());
11188
      if (lastComparison != 0) {
11189
        return lastComparison;
11190
      }
11191
      if (isSetItemIds()) {
11192
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.itemIds, typedOther.itemIds);
11193
        if (lastComparison != 0) {
11194
          return lastComparison;
11195
        }
11196
      }
11197
      return 0;
11198
    }
11199
 
11200
    public _Fields fieldForId(int fieldId) {
11201
      return _Fields.findByThriftId(fieldId);
11202
    }
11203
 
11204
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
11205
      org.apache.thrift.protocol.TField field;
11206
      iprot.readStructBegin();
11207
      while (true)
11208
      {
11209
        field = iprot.readFieldBegin();
11210
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
11211
          break;
11212
        }
11213
        switch (field.id) {
11214
          case 1: // ITEM_IDS
11215
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
11216
              {
5327 rajveer 11217
                org.apache.thrift.protocol.TList _list20 = iprot.readListBegin();
11218
                this.itemIds = new ArrayList<Long>(_list20.size);
11219
                for (int _i21 = 0; _i21 < _list20.size; ++_i21)
4189 varun.gupt 11220
                {
5327 rajveer 11221
                  long _elem22; // required
11222
                  _elem22 = iprot.readI64();
11223
                  this.itemIds.add(_elem22);
4189 varun.gupt 11224
                }
11225
                iprot.readListEnd();
11226
              }
11227
            } else { 
11228
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11229
            }
11230
            break;
11231
          default:
11232
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11233
        }
11234
        iprot.readFieldEnd();
11235
      }
11236
      iprot.readStructEnd();
11237
      validate();
11238
    }
11239
 
11240
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
11241
      validate();
11242
 
11243
      oprot.writeStructBegin(STRUCT_DESC);
11244
      if (this.itemIds != null) {
11245
        oprot.writeFieldBegin(ITEM_IDS_FIELD_DESC);
11246
        {
11247
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, this.itemIds.size()));
5327 rajveer 11248
          for (long _iter23 : this.itemIds)
4189 varun.gupt 11249
          {
5327 rajveer 11250
            oprot.writeI64(_iter23);
4189 varun.gupt 11251
          }
11252
          oprot.writeListEnd();
11253
        }
11254
        oprot.writeFieldEnd();
11255
      }
11256
      oprot.writeFieldStop();
11257
      oprot.writeStructEnd();
11258
    }
11259
 
11260
    @Override
11261
    public String toString() {
11262
      StringBuilder sb = new StringBuilder("getItemDiscountMap_args(");
11263
      boolean first = true;
11264
 
11265
      sb.append("itemIds:");
11266
      if (this.itemIds == null) {
11267
        sb.append("null");
11268
      } else {
11269
        sb.append(this.itemIds);
11270
      }
11271
      first = false;
11272
      sb.append(")");
11273
      return sb.toString();
11274
    }
11275
 
11276
    public void validate() throws org.apache.thrift.TException {
11277
      // check for required fields
11278
    }
11279
 
11280
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
11281
      try {
11282
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
11283
      } catch (org.apache.thrift.TException te) {
11284
        throw new java.io.IOException(te);
11285
      }
11286
    }
11287
 
11288
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
11289
      try {
11290
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
11291
      } catch (org.apache.thrift.TException te) {
11292
        throw new java.io.IOException(te);
11293
      }
11294
    }
11295
 
11296
  }
11297
 
11298
  public static class getItemDiscountMap_result implements org.apache.thrift.TBase<getItemDiscountMap_result, getItemDiscountMap_result._Fields>, java.io.Serializable, Cloneable   {
11299
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemDiscountMap_result");
11300
 
11301
    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);
11302
    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);
11303
 
11304
    private List<ItemCouponDiscount> success; // required
11305
    private PromotionException pex; // required
11306
 
11307
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
11308
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
11309
      SUCCESS((short)0, "success"),
11310
      PEX((short)1, "pex");
11311
 
11312
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
11313
 
11314
      static {
11315
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
11316
          byName.put(field.getFieldName(), field);
11317
        }
11318
      }
11319
 
11320
      /**
11321
       * Find the _Fields constant that matches fieldId, or null if its not found.
11322
       */
11323
      public static _Fields findByThriftId(int fieldId) {
11324
        switch(fieldId) {
11325
          case 0: // SUCCESS
11326
            return SUCCESS;
11327
          case 1: // PEX
11328
            return PEX;
11329
          default:
11330
            return null;
11331
        }
11332
      }
11333
 
11334
      /**
11335
       * Find the _Fields constant that matches fieldId, throwing an exception
11336
       * if it is not found.
11337
       */
11338
      public static _Fields findByThriftIdOrThrow(int fieldId) {
11339
        _Fields fields = findByThriftId(fieldId);
11340
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
11341
        return fields;
11342
      }
11343
 
11344
      /**
11345
       * Find the _Fields constant that matches name, or null if its not found.
11346
       */
11347
      public static _Fields findByName(String name) {
11348
        return byName.get(name);
11349
      }
11350
 
11351
      private final short _thriftId;
11352
      private final String _fieldName;
11353
 
11354
      _Fields(short thriftId, String fieldName) {
11355
        _thriftId = thriftId;
11356
        _fieldName = fieldName;
11357
      }
11358
 
11359
      public short getThriftFieldId() {
11360
        return _thriftId;
11361
      }
11362
 
11363
      public String getFieldName() {
11364
        return _fieldName;
11365
      }
11366
    }
11367
 
11368
    // isset id assignments
11369
 
11370
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
11371
    static {
11372
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
11373
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11374
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
11375
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ItemCouponDiscount.class))));
11376
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11377
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
11378
      metaDataMap = Collections.unmodifiableMap(tmpMap);
11379
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getItemDiscountMap_result.class, metaDataMap);
11380
    }
11381
 
11382
    public getItemDiscountMap_result() {
11383
    }
11384
 
11385
    public getItemDiscountMap_result(
11386
      List<ItemCouponDiscount> success,
11387
      PromotionException pex)
11388
    {
11389
      this();
11390
      this.success = success;
11391
      this.pex = pex;
11392
    }
11393
 
11394
    /**
11395
     * Performs a deep copy on <i>other</i>.
11396
     */
11397
    public getItemDiscountMap_result(getItemDiscountMap_result other) {
11398
      if (other.isSetSuccess()) {
11399
        List<ItemCouponDiscount> __this__success = new ArrayList<ItemCouponDiscount>();
11400
        for (ItemCouponDiscount other_element : other.success) {
11401
          __this__success.add(new ItemCouponDiscount(other_element));
11402
        }
11403
        this.success = __this__success;
11404
      }
11405
      if (other.isSetPex()) {
11406
        this.pex = new PromotionException(other.pex);
11407
      }
11408
    }
11409
 
11410
    public getItemDiscountMap_result deepCopy() {
11411
      return new getItemDiscountMap_result(this);
11412
    }
11413
 
11414
    @Override
11415
    public void clear() {
11416
      this.success = null;
11417
      this.pex = null;
11418
    }
11419
 
11420
    public int getSuccessSize() {
11421
      return (this.success == null) ? 0 : this.success.size();
11422
    }
11423
 
11424
    public java.util.Iterator<ItemCouponDiscount> getSuccessIterator() {
11425
      return (this.success == null) ? null : this.success.iterator();
11426
    }
11427
 
11428
    public void addToSuccess(ItemCouponDiscount elem) {
11429
      if (this.success == null) {
11430
        this.success = new ArrayList<ItemCouponDiscount>();
11431
      }
11432
      this.success.add(elem);
11433
    }
11434
 
11435
    public List<ItemCouponDiscount> getSuccess() {
11436
      return this.success;
11437
    }
11438
 
11439
    public void setSuccess(List<ItemCouponDiscount> success) {
11440
      this.success = success;
11441
    }
11442
 
11443
    public void unsetSuccess() {
11444
      this.success = null;
11445
    }
11446
 
11447
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
11448
    public boolean isSetSuccess() {
11449
      return this.success != null;
11450
    }
11451
 
11452
    public void setSuccessIsSet(boolean value) {
11453
      if (!value) {
11454
        this.success = null;
11455
      }
11456
    }
11457
 
11458
    public PromotionException getPex() {
11459
      return this.pex;
11460
    }
11461
 
11462
    public void setPex(PromotionException pex) {
11463
      this.pex = pex;
11464
    }
11465
 
11466
    public void unsetPex() {
11467
      this.pex = null;
11468
    }
11469
 
11470
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
11471
    public boolean isSetPex() {
11472
      return this.pex != null;
11473
    }
11474
 
11475
    public void setPexIsSet(boolean value) {
11476
      if (!value) {
11477
        this.pex = null;
11478
      }
11479
    }
11480
 
11481
    public void setFieldValue(_Fields field, Object value) {
11482
      switch (field) {
11483
      case SUCCESS:
11484
        if (value == null) {
11485
          unsetSuccess();
11486
        } else {
11487
          setSuccess((List<ItemCouponDiscount>)value);
11488
        }
11489
        break;
11490
 
11491
      case PEX:
11492
        if (value == null) {
11493
          unsetPex();
11494
        } else {
11495
          setPex((PromotionException)value);
11496
        }
11497
        break;
11498
 
11499
      }
11500
    }
11501
 
11502
    public Object getFieldValue(_Fields field) {
11503
      switch (field) {
11504
      case SUCCESS:
11505
        return getSuccess();
11506
 
11507
      case PEX:
11508
        return getPex();
11509
 
11510
      }
11511
      throw new IllegalStateException();
11512
    }
11513
 
11514
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
11515
    public boolean isSet(_Fields field) {
11516
      if (field == null) {
11517
        throw new IllegalArgumentException();
11518
      }
11519
 
11520
      switch (field) {
11521
      case SUCCESS:
11522
        return isSetSuccess();
11523
      case PEX:
11524
        return isSetPex();
11525
      }
11526
      throw new IllegalStateException();
11527
    }
11528
 
11529
    @Override
11530
    public boolean equals(Object that) {
11531
      if (that == null)
11532
        return false;
11533
      if (that instanceof getItemDiscountMap_result)
11534
        return this.equals((getItemDiscountMap_result)that);
11535
      return false;
11536
    }
11537
 
11538
    public boolean equals(getItemDiscountMap_result that) {
11539
      if (that == null)
11540
        return false;
11541
 
11542
      boolean this_present_success = true && this.isSetSuccess();
11543
      boolean that_present_success = true && that.isSetSuccess();
11544
      if (this_present_success || that_present_success) {
11545
        if (!(this_present_success && that_present_success))
11546
          return false;
11547
        if (!this.success.equals(that.success))
11548
          return false;
11549
      }
11550
 
11551
      boolean this_present_pex = true && this.isSetPex();
11552
      boolean that_present_pex = true && that.isSetPex();
11553
      if (this_present_pex || that_present_pex) {
11554
        if (!(this_present_pex && that_present_pex))
11555
          return false;
11556
        if (!this.pex.equals(that.pex))
11557
          return false;
11558
      }
11559
 
11560
      return true;
11561
    }
11562
 
11563
    @Override
11564
    public int hashCode() {
11565
      return 0;
11566
    }
11567
 
11568
    public int compareTo(getItemDiscountMap_result other) {
11569
      if (!getClass().equals(other.getClass())) {
11570
        return getClass().getName().compareTo(other.getClass().getName());
11571
      }
11572
 
11573
      int lastComparison = 0;
11574
      getItemDiscountMap_result typedOther = (getItemDiscountMap_result)other;
11575
 
11576
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
11577
      if (lastComparison != 0) {
11578
        return lastComparison;
11579
      }
11580
      if (isSetSuccess()) {
11581
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
11582
        if (lastComparison != 0) {
11583
          return lastComparison;
11584
        }
11585
      }
11586
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
11587
      if (lastComparison != 0) {
11588
        return lastComparison;
11589
      }
11590
      if (isSetPex()) {
11591
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
11592
        if (lastComparison != 0) {
11593
          return lastComparison;
11594
        }
11595
      }
11596
      return 0;
11597
    }
11598
 
11599
    public _Fields fieldForId(int fieldId) {
11600
      return _Fields.findByThriftId(fieldId);
11601
    }
11602
 
11603
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
11604
      org.apache.thrift.protocol.TField field;
11605
      iprot.readStructBegin();
11606
      while (true)
11607
      {
11608
        field = iprot.readFieldBegin();
11609
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
11610
          break;
11611
        }
11612
        switch (field.id) {
11613
          case 0: // SUCCESS
11614
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
11615
              {
5327 rajveer 11616
                org.apache.thrift.protocol.TList _list24 = iprot.readListBegin();
11617
                this.success = new ArrayList<ItemCouponDiscount>(_list24.size);
11618
                for (int _i25 = 0; _i25 < _list24.size; ++_i25)
4189 varun.gupt 11619
                {
5327 rajveer 11620
                  ItemCouponDiscount _elem26; // required
11621
                  _elem26 = new ItemCouponDiscount();
11622
                  _elem26.read(iprot);
11623
                  this.success.add(_elem26);
4189 varun.gupt 11624
                }
11625
                iprot.readListEnd();
11626
              }
11627
            } else { 
11628
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11629
            }
11630
            break;
11631
          case 1: // PEX
11632
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
11633
              this.pex = new PromotionException();
11634
              this.pex.read(iprot);
11635
            } else { 
11636
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11637
            }
11638
            break;
11639
          default:
11640
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11641
        }
11642
        iprot.readFieldEnd();
11643
      }
11644
      iprot.readStructEnd();
11645
      validate();
11646
    }
11647
 
11648
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
11649
      oprot.writeStructBegin(STRUCT_DESC);
11650
 
11651
      if (this.isSetSuccess()) {
11652
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
11653
        {
11654
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
5327 rajveer 11655
          for (ItemCouponDiscount _iter27 : this.success)
4189 varun.gupt 11656
          {
5327 rajveer 11657
            _iter27.write(oprot);
4189 varun.gupt 11658
          }
11659
          oprot.writeListEnd();
11660
        }
11661
        oprot.writeFieldEnd();
11662
      } else if (this.isSetPex()) {
11663
        oprot.writeFieldBegin(PEX_FIELD_DESC);
11664
        this.pex.write(oprot);
11665
        oprot.writeFieldEnd();
11666
      }
11667
      oprot.writeFieldStop();
11668
      oprot.writeStructEnd();
11669
    }
11670
 
11671
    @Override
11672
    public String toString() {
11673
      StringBuilder sb = new StringBuilder("getItemDiscountMap_result(");
11674
      boolean first = true;
11675
 
11676
      sb.append("success:");
11677
      if (this.success == null) {
11678
        sb.append("null");
11679
      } else {
11680
        sb.append(this.success);
11681
      }
11682
      first = false;
11683
      if (!first) sb.append(", ");
11684
      sb.append("pex:");
11685
      if (this.pex == null) {
11686
        sb.append("null");
11687
      } else {
11688
        sb.append(this.pex);
11689
      }
11690
      first = false;
11691
      sb.append(")");
11692
      return sb.toString();
11693
    }
11694
 
11695
    public void validate() throws org.apache.thrift.TException {
11696
      // check for required fields
11697
    }
11698
 
11699
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
11700
      try {
11701
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
11702
      } catch (org.apache.thrift.TException te) {
11703
        throw new java.io.IOException(te);
11704
      }
11705
    }
11706
 
11707
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
11708
      try {
11709
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
11710
      } catch (org.apache.thrift.TException te) {
11711
        throw new java.io.IOException(te);
11712
      }
11713
    }
11714
 
11715
  }
11716
 
4494 varun.gupt 11717
  public static class getDiscountsForEntity_args implements org.apache.thrift.TBase<getDiscountsForEntity_args, getDiscountsForEntity_args._Fields>, java.io.Serializable, Cloneable   {
11718
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getDiscountsForEntity_args");
11719
 
11720
    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);
11721
 
11722
    private long entityId; // required
11723
 
11724
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
11725
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
11726
      ENTITY_ID((short)1, "entityId");
11727
 
11728
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
11729
 
11730
      static {
11731
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
11732
          byName.put(field.getFieldName(), field);
11733
        }
11734
      }
11735
 
11736
      /**
11737
       * Find the _Fields constant that matches fieldId, or null if its not found.
11738
       */
11739
      public static _Fields findByThriftId(int fieldId) {
11740
        switch(fieldId) {
11741
          case 1: // ENTITY_ID
11742
            return ENTITY_ID;
11743
          default:
11744
            return null;
11745
        }
11746
      }
11747
 
11748
      /**
11749
       * Find the _Fields constant that matches fieldId, throwing an exception
11750
       * if it is not found.
11751
       */
11752
      public static _Fields findByThriftIdOrThrow(int fieldId) {
11753
        _Fields fields = findByThriftId(fieldId);
11754
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
11755
        return fields;
11756
      }
11757
 
11758
      /**
11759
       * Find the _Fields constant that matches name, or null if its not found.
11760
       */
11761
      public static _Fields findByName(String name) {
11762
        return byName.get(name);
11763
      }
11764
 
11765
      private final short _thriftId;
11766
      private final String _fieldName;
11767
 
11768
      _Fields(short thriftId, String fieldName) {
11769
        _thriftId = thriftId;
11770
        _fieldName = fieldName;
11771
      }
11772
 
11773
      public short getThriftFieldId() {
11774
        return _thriftId;
11775
      }
11776
 
11777
      public String getFieldName() {
11778
        return _fieldName;
11779
      }
11780
    }
11781
 
11782
    // isset id assignments
11783
    private static final int __ENTITYID_ISSET_ID = 0;
11784
    private BitSet __isset_bit_vector = new BitSet(1);
11785
 
11786
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
11787
    static {
11788
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
11789
      tmpMap.put(_Fields.ENTITY_ID, new org.apache.thrift.meta_data.FieldMetaData("entityId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11790
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
11791
      metaDataMap = Collections.unmodifiableMap(tmpMap);
11792
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getDiscountsForEntity_args.class, metaDataMap);
11793
    }
11794
 
11795
    public getDiscountsForEntity_args() {
11796
    }
11797
 
11798
    public getDiscountsForEntity_args(
11799
      long entityId)
11800
    {
11801
      this();
11802
      this.entityId = entityId;
11803
      setEntityIdIsSet(true);
11804
    }
11805
 
11806
    /**
11807
     * Performs a deep copy on <i>other</i>.
11808
     */
11809
    public getDiscountsForEntity_args(getDiscountsForEntity_args other) {
11810
      __isset_bit_vector.clear();
11811
      __isset_bit_vector.or(other.__isset_bit_vector);
11812
      this.entityId = other.entityId;
11813
    }
11814
 
11815
    public getDiscountsForEntity_args deepCopy() {
11816
      return new getDiscountsForEntity_args(this);
11817
    }
11818
 
11819
    @Override
11820
    public void clear() {
11821
      setEntityIdIsSet(false);
11822
      this.entityId = 0;
11823
    }
11824
 
11825
    public long getEntityId() {
11826
      return this.entityId;
11827
    }
11828
 
11829
    public void setEntityId(long entityId) {
11830
      this.entityId = entityId;
11831
      setEntityIdIsSet(true);
11832
    }
11833
 
11834
    public void unsetEntityId() {
11835
      __isset_bit_vector.clear(__ENTITYID_ISSET_ID);
11836
    }
11837
 
11838
    /** Returns true if field entityId is set (has been assigned a value) and false otherwise */
11839
    public boolean isSetEntityId() {
11840
      return __isset_bit_vector.get(__ENTITYID_ISSET_ID);
11841
    }
11842
 
11843
    public void setEntityIdIsSet(boolean value) {
11844
      __isset_bit_vector.set(__ENTITYID_ISSET_ID, value);
11845
    }
11846
 
11847
    public void setFieldValue(_Fields field, Object value) {
11848
      switch (field) {
11849
      case ENTITY_ID:
11850
        if (value == null) {
11851
          unsetEntityId();
11852
        } else {
11853
          setEntityId((Long)value);
11854
        }
11855
        break;
11856
 
11857
      }
11858
    }
11859
 
11860
    public Object getFieldValue(_Fields field) {
11861
      switch (field) {
11862
      case ENTITY_ID:
11863
        return Long.valueOf(getEntityId());
11864
 
11865
      }
11866
      throw new IllegalStateException();
11867
    }
11868
 
11869
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
11870
    public boolean isSet(_Fields field) {
11871
      if (field == null) {
11872
        throw new IllegalArgumentException();
11873
      }
11874
 
11875
      switch (field) {
11876
      case ENTITY_ID:
11877
        return isSetEntityId();
11878
      }
11879
      throw new IllegalStateException();
11880
    }
11881
 
11882
    @Override
11883
    public boolean equals(Object that) {
11884
      if (that == null)
11885
        return false;
11886
      if (that instanceof getDiscountsForEntity_args)
11887
        return this.equals((getDiscountsForEntity_args)that);
11888
      return false;
11889
    }
11890
 
11891
    public boolean equals(getDiscountsForEntity_args that) {
11892
      if (that == null)
11893
        return false;
11894
 
11895
      boolean this_present_entityId = true;
11896
      boolean that_present_entityId = true;
11897
      if (this_present_entityId || that_present_entityId) {
11898
        if (!(this_present_entityId && that_present_entityId))
11899
          return false;
11900
        if (this.entityId != that.entityId)
11901
          return false;
11902
      }
11903
 
11904
      return true;
11905
    }
11906
 
11907
    @Override
11908
    public int hashCode() {
11909
      return 0;
11910
    }
11911
 
11912
    public int compareTo(getDiscountsForEntity_args other) {
11913
      if (!getClass().equals(other.getClass())) {
11914
        return getClass().getName().compareTo(other.getClass().getName());
11915
      }
11916
 
11917
      int lastComparison = 0;
11918
      getDiscountsForEntity_args typedOther = (getDiscountsForEntity_args)other;
11919
 
11920
      lastComparison = Boolean.valueOf(isSetEntityId()).compareTo(typedOther.isSetEntityId());
11921
      if (lastComparison != 0) {
11922
        return lastComparison;
11923
      }
11924
      if (isSetEntityId()) {
11925
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityId, typedOther.entityId);
11926
        if (lastComparison != 0) {
11927
          return lastComparison;
11928
        }
11929
      }
11930
      return 0;
11931
    }
11932
 
11933
    public _Fields fieldForId(int fieldId) {
11934
      return _Fields.findByThriftId(fieldId);
11935
    }
11936
 
11937
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
11938
      org.apache.thrift.protocol.TField field;
11939
      iprot.readStructBegin();
11940
      while (true)
11941
      {
11942
        field = iprot.readFieldBegin();
11943
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
11944
          break;
11945
        }
11946
        switch (field.id) {
11947
          case 1: // ENTITY_ID
11948
            if (field.type == org.apache.thrift.protocol.TType.I64) {
11949
              this.entityId = iprot.readI64();
11950
              setEntityIdIsSet(true);
11951
            } else { 
11952
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11953
            }
11954
            break;
11955
          default:
11956
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11957
        }
11958
        iprot.readFieldEnd();
11959
      }
11960
      iprot.readStructEnd();
11961
      validate();
11962
    }
11963
 
11964
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
11965
      validate();
11966
 
11967
      oprot.writeStructBegin(STRUCT_DESC);
11968
      oprot.writeFieldBegin(ENTITY_ID_FIELD_DESC);
11969
      oprot.writeI64(this.entityId);
11970
      oprot.writeFieldEnd();
11971
      oprot.writeFieldStop();
11972
      oprot.writeStructEnd();
11973
    }
11974
 
11975
    @Override
11976
    public String toString() {
11977
      StringBuilder sb = new StringBuilder("getDiscountsForEntity_args(");
11978
      boolean first = true;
11979
 
11980
      sb.append("entityId:");
11981
      sb.append(this.entityId);
11982
      first = false;
11983
      sb.append(")");
11984
      return sb.toString();
11985
    }
11986
 
11987
    public void validate() throws org.apache.thrift.TException {
11988
      // check for required fields
11989
    }
11990
 
11991
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
11992
      try {
11993
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
11994
      } catch (org.apache.thrift.TException te) {
11995
        throw new java.io.IOException(te);
11996
      }
11997
    }
11998
 
11999
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
12000
      try {
12001
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
12002
        __isset_bit_vector = new BitSet(1);
12003
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
12004
      } catch (org.apache.thrift.TException te) {
12005
        throw new java.io.IOException(te);
12006
      }
12007
    }
12008
 
12009
  }
12010
 
12011
  public static class getDiscountsForEntity_result implements org.apache.thrift.TBase<getDiscountsForEntity_result, getDiscountsForEntity_result._Fields>, java.io.Serializable, Cloneable   {
12012
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getDiscountsForEntity_result");
12013
 
12014
    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);
12015
 
12016
    private Map<String,Double> success; // required
12017
 
12018
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
12019
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
12020
      SUCCESS((short)0, "success");
12021
 
12022
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
12023
 
12024
      static {
12025
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
12026
          byName.put(field.getFieldName(), field);
12027
        }
12028
      }
12029
 
12030
      /**
12031
       * Find the _Fields constant that matches fieldId, or null if its not found.
12032
       */
12033
      public static _Fields findByThriftId(int fieldId) {
12034
        switch(fieldId) {
12035
          case 0: // SUCCESS
12036
            return SUCCESS;
12037
          default:
12038
            return null;
12039
        }
12040
      }
12041
 
12042
      /**
12043
       * Find the _Fields constant that matches fieldId, throwing an exception
12044
       * if it is not found.
12045
       */
12046
      public static _Fields findByThriftIdOrThrow(int fieldId) {
12047
        _Fields fields = findByThriftId(fieldId);
12048
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
12049
        return fields;
12050
      }
12051
 
12052
      /**
12053
       * Find the _Fields constant that matches name, or null if its not found.
12054
       */
12055
      public static _Fields findByName(String name) {
12056
        return byName.get(name);
12057
      }
12058
 
12059
      private final short _thriftId;
12060
      private final String _fieldName;
12061
 
12062
      _Fields(short thriftId, String fieldName) {
12063
        _thriftId = thriftId;
12064
        _fieldName = fieldName;
12065
      }
12066
 
12067
      public short getThriftFieldId() {
12068
        return _thriftId;
12069
      }
12070
 
12071
      public String getFieldName() {
12072
        return _fieldName;
12073
      }
12074
    }
12075
 
12076
    // isset id assignments
12077
 
12078
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
12079
    static {
12080
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
12081
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12082
          new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
12083
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), 
12084
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))));
12085
      metaDataMap = Collections.unmodifiableMap(tmpMap);
12086
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getDiscountsForEntity_result.class, metaDataMap);
12087
    }
12088
 
12089
    public getDiscountsForEntity_result() {
12090
    }
12091
 
12092
    public getDiscountsForEntity_result(
12093
      Map<String,Double> success)
12094
    {
12095
      this();
12096
      this.success = success;
12097
    }
12098
 
12099
    /**
12100
     * Performs a deep copy on <i>other</i>.
12101
     */
12102
    public getDiscountsForEntity_result(getDiscountsForEntity_result other) {
12103
      if (other.isSetSuccess()) {
12104
        Map<String,Double> __this__success = new HashMap<String,Double>();
12105
        for (Map.Entry<String, Double> other_element : other.success.entrySet()) {
12106
 
12107
          String other_element_key = other_element.getKey();
12108
          Double other_element_value = other_element.getValue();
12109
 
12110
          String __this__success_copy_key = other_element_key;
12111
 
12112
          Double __this__success_copy_value = other_element_value;
12113
 
12114
          __this__success.put(__this__success_copy_key, __this__success_copy_value);
12115
        }
12116
        this.success = __this__success;
12117
      }
12118
    }
12119
 
12120
    public getDiscountsForEntity_result deepCopy() {
12121
      return new getDiscountsForEntity_result(this);
12122
    }
12123
 
12124
    @Override
12125
    public void clear() {
12126
      this.success = null;
12127
    }
12128
 
12129
    public int getSuccessSize() {
12130
      return (this.success == null) ? 0 : this.success.size();
12131
    }
12132
 
12133
    public void putToSuccess(String key, double val) {
12134
      if (this.success == null) {
12135
        this.success = new HashMap<String,Double>();
12136
      }
12137
      this.success.put(key, val);
12138
    }
12139
 
12140
    public Map<String,Double> getSuccess() {
12141
      return this.success;
12142
    }
12143
 
12144
    public void setSuccess(Map<String,Double> success) {
12145
      this.success = success;
12146
    }
12147
 
12148
    public void unsetSuccess() {
12149
      this.success = null;
12150
    }
12151
 
12152
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
12153
    public boolean isSetSuccess() {
12154
      return this.success != null;
12155
    }
12156
 
12157
    public void setSuccessIsSet(boolean value) {
12158
      if (!value) {
12159
        this.success = null;
12160
      }
12161
    }
12162
 
12163
    public void setFieldValue(_Fields field, Object value) {
12164
      switch (field) {
12165
      case SUCCESS:
12166
        if (value == null) {
12167
          unsetSuccess();
12168
        } else {
12169
          setSuccess((Map<String,Double>)value);
12170
        }
12171
        break;
12172
 
12173
      }
12174
    }
12175
 
12176
    public Object getFieldValue(_Fields field) {
12177
      switch (field) {
12178
      case SUCCESS:
12179
        return getSuccess();
12180
 
12181
      }
12182
      throw new IllegalStateException();
12183
    }
12184
 
12185
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
12186
    public boolean isSet(_Fields field) {
12187
      if (field == null) {
12188
        throw new IllegalArgumentException();
12189
      }
12190
 
12191
      switch (field) {
12192
      case SUCCESS:
12193
        return isSetSuccess();
12194
      }
12195
      throw new IllegalStateException();
12196
    }
12197
 
12198
    @Override
12199
    public boolean equals(Object that) {
12200
      if (that == null)
12201
        return false;
12202
      if (that instanceof getDiscountsForEntity_result)
12203
        return this.equals((getDiscountsForEntity_result)that);
12204
      return false;
12205
    }
12206
 
12207
    public boolean equals(getDiscountsForEntity_result that) {
12208
      if (that == null)
12209
        return false;
12210
 
12211
      boolean this_present_success = true && this.isSetSuccess();
12212
      boolean that_present_success = true && that.isSetSuccess();
12213
      if (this_present_success || that_present_success) {
12214
        if (!(this_present_success && that_present_success))
12215
          return false;
12216
        if (!this.success.equals(that.success))
12217
          return false;
12218
      }
12219
 
12220
      return true;
12221
    }
12222
 
12223
    @Override
12224
    public int hashCode() {
12225
      return 0;
12226
    }
12227
 
12228
    public int compareTo(getDiscountsForEntity_result other) {
12229
      if (!getClass().equals(other.getClass())) {
12230
        return getClass().getName().compareTo(other.getClass().getName());
12231
      }
12232
 
12233
      int lastComparison = 0;
12234
      getDiscountsForEntity_result typedOther = (getDiscountsForEntity_result)other;
12235
 
12236
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
12237
      if (lastComparison != 0) {
12238
        return lastComparison;
12239
      }
12240
      if (isSetSuccess()) {
12241
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
12242
        if (lastComparison != 0) {
12243
          return lastComparison;
12244
        }
12245
      }
12246
      return 0;
12247
    }
12248
 
12249
    public _Fields fieldForId(int fieldId) {
12250
      return _Fields.findByThriftId(fieldId);
12251
    }
12252
 
12253
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
12254
      org.apache.thrift.protocol.TField field;
12255
      iprot.readStructBegin();
12256
      while (true)
12257
      {
12258
        field = iprot.readFieldBegin();
12259
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
12260
          break;
12261
        }
12262
        switch (field.id) {
12263
          case 0: // SUCCESS
12264
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
12265
              {
5327 rajveer 12266
                org.apache.thrift.protocol.TMap _map28 = iprot.readMapBegin();
12267
                this.success = new HashMap<String,Double>(2*_map28.size);
12268
                for (int _i29 = 0; _i29 < _map28.size; ++_i29)
4494 varun.gupt 12269
                {
5327 rajveer 12270
                  String _key30; // required
12271
                  double _val31; // required
12272
                  _key30 = iprot.readString();
12273
                  _val31 = iprot.readDouble();
12274
                  this.success.put(_key30, _val31);
4494 varun.gupt 12275
                }
12276
                iprot.readMapEnd();
12277
              }
12278
            } else { 
12279
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12280
            }
12281
            break;
12282
          default:
12283
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12284
        }
12285
        iprot.readFieldEnd();
12286
      }
12287
      iprot.readStructEnd();
12288
      validate();
12289
    }
12290
 
12291
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
12292
      oprot.writeStructBegin(STRUCT_DESC);
12293
 
12294
      if (this.isSetSuccess()) {
12295
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
12296
        {
12297
          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 12298
          for (Map.Entry<String, Double> _iter32 : this.success.entrySet())
4494 varun.gupt 12299
          {
5327 rajveer 12300
            oprot.writeString(_iter32.getKey());
12301
            oprot.writeDouble(_iter32.getValue());
4494 varun.gupt 12302
          }
12303
          oprot.writeMapEnd();
12304
        }
12305
        oprot.writeFieldEnd();
12306
      }
12307
      oprot.writeFieldStop();
12308
      oprot.writeStructEnd();
12309
    }
12310
 
12311
    @Override
12312
    public String toString() {
12313
      StringBuilder sb = new StringBuilder("getDiscountsForEntity_result(");
12314
      boolean first = true;
12315
 
12316
      sb.append("success:");
12317
      if (this.success == null) {
12318
        sb.append("null");
12319
      } else {
12320
        sb.append(this.success);
12321
      }
12322
      first = false;
12323
      sb.append(")");
12324
      return sb.toString();
12325
    }
12326
 
12327
    public void validate() throws org.apache.thrift.TException {
12328
      // check for required fields
12329
    }
12330
 
12331
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
12332
      try {
12333
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
12334
      } catch (org.apache.thrift.TException te) {
12335
        throw new java.io.IOException(te);
12336
      }
12337
    }
12338
 
12339
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
12340
      try {
12341
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
12342
      } catch (org.apache.thrift.TException te) {
12343
        throw new java.io.IOException(te);
12344
      }
12345
    }
12346
 
12347
  }
12348
 
5469 rajveer 12349
  public static class addVoucher_args implements org.apache.thrift.TBase<addVoucher_args, addVoucher_args._Fields>, java.io.Serializable, Cloneable   {
12350
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addVoucher_args");
12351
 
12352
    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);
12353
 
12354
    private Voucher voucher; // required
12355
 
12356
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
12357
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
12358
      VOUCHER((short)1, "voucher");
12359
 
12360
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
12361
 
12362
      static {
12363
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
12364
          byName.put(field.getFieldName(), field);
12365
        }
12366
      }
12367
 
12368
      /**
12369
       * Find the _Fields constant that matches fieldId, or null if its not found.
12370
       */
12371
      public static _Fields findByThriftId(int fieldId) {
12372
        switch(fieldId) {
12373
          case 1: // VOUCHER
12374
            return VOUCHER;
12375
          default:
12376
            return null;
12377
        }
12378
      }
12379
 
12380
      /**
12381
       * Find the _Fields constant that matches fieldId, throwing an exception
12382
       * if it is not found.
12383
       */
12384
      public static _Fields findByThriftIdOrThrow(int fieldId) {
12385
        _Fields fields = findByThriftId(fieldId);
12386
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
12387
        return fields;
12388
      }
12389
 
12390
      /**
12391
       * Find the _Fields constant that matches name, or null if its not found.
12392
       */
12393
      public static _Fields findByName(String name) {
12394
        return byName.get(name);
12395
      }
12396
 
12397
      private final short _thriftId;
12398
      private final String _fieldName;
12399
 
12400
      _Fields(short thriftId, String fieldName) {
12401
        _thriftId = thriftId;
12402
        _fieldName = fieldName;
12403
      }
12404
 
12405
      public short getThriftFieldId() {
12406
        return _thriftId;
12407
      }
12408
 
12409
      public String getFieldName() {
12410
        return _fieldName;
12411
      }
12412
    }
12413
 
12414
    // isset id assignments
12415
 
12416
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
12417
    static {
12418
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
12419
      tmpMap.put(_Fields.VOUCHER, new org.apache.thrift.meta_data.FieldMetaData("voucher", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12420
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Voucher.class)));
12421
      metaDataMap = Collections.unmodifiableMap(tmpMap);
12422
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addVoucher_args.class, metaDataMap);
12423
    }
12424
 
12425
    public addVoucher_args() {
12426
    }
12427
 
12428
    public addVoucher_args(
12429
      Voucher voucher)
12430
    {
12431
      this();
12432
      this.voucher = voucher;
12433
    }
12434
 
12435
    /**
12436
     * Performs a deep copy on <i>other</i>.
12437
     */
12438
    public addVoucher_args(addVoucher_args other) {
12439
      if (other.isSetVoucher()) {
12440
        this.voucher = new Voucher(other.voucher);
12441
      }
12442
    }
12443
 
12444
    public addVoucher_args deepCopy() {
12445
      return new addVoucher_args(this);
12446
    }
12447
 
12448
    @Override
12449
    public void clear() {
12450
      this.voucher = null;
12451
    }
12452
 
12453
    public Voucher getVoucher() {
12454
      return this.voucher;
12455
    }
12456
 
12457
    public void setVoucher(Voucher voucher) {
12458
      this.voucher = voucher;
12459
    }
12460
 
12461
    public void unsetVoucher() {
12462
      this.voucher = null;
12463
    }
12464
 
12465
    /** Returns true if field voucher is set (has been assigned a value) and false otherwise */
12466
    public boolean isSetVoucher() {
12467
      return this.voucher != null;
12468
    }
12469
 
12470
    public void setVoucherIsSet(boolean value) {
12471
      if (!value) {
12472
        this.voucher = null;
12473
      }
12474
    }
12475
 
12476
    public void setFieldValue(_Fields field, Object value) {
12477
      switch (field) {
12478
      case VOUCHER:
12479
        if (value == null) {
12480
          unsetVoucher();
12481
        } else {
12482
          setVoucher((Voucher)value);
12483
        }
12484
        break;
12485
 
12486
      }
12487
    }
12488
 
12489
    public Object getFieldValue(_Fields field) {
12490
      switch (field) {
12491
      case VOUCHER:
12492
        return getVoucher();
12493
 
12494
      }
12495
      throw new IllegalStateException();
12496
    }
12497
 
12498
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
12499
    public boolean isSet(_Fields field) {
12500
      if (field == null) {
12501
        throw new IllegalArgumentException();
12502
      }
12503
 
12504
      switch (field) {
12505
      case VOUCHER:
12506
        return isSetVoucher();
12507
      }
12508
      throw new IllegalStateException();
12509
    }
12510
 
12511
    @Override
12512
    public boolean equals(Object that) {
12513
      if (that == null)
12514
        return false;
12515
      if (that instanceof addVoucher_args)
12516
        return this.equals((addVoucher_args)that);
12517
      return false;
12518
    }
12519
 
12520
    public boolean equals(addVoucher_args that) {
12521
      if (that == null)
12522
        return false;
12523
 
12524
      boolean this_present_voucher = true && this.isSetVoucher();
12525
      boolean that_present_voucher = true && that.isSetVoucher();
12526
      if (this_present_voucher || that_present_voucher) {
12527
        if (!(this_present_voucher && that_present_voucher))
12528
          return false;
12529
        if (!this.voucher.equals(that.voucher))
12530
          return false;
12531
      }
12532
 
12533
      return true;
12534
    }
12535
 
12536
    @Override
12537
    public int hashCode() {
12538
      return 0;
12539
    }
12540
 
12541
    public int compareTo(addVoucher_args other) {
12542
      if (!getClass().equals(other.getClass())) {
12543
        return getClass().getName().compareTo(other.getClass().getName());
12544
      }
12545
 
12546
      int lastComparison = 0;
12547
      addVoucher_args typedOther = (addVoucher_args)other;
12548
 
12549
      lastComparison = Boolean.valueOf(isSetVoucher()).compareTo(typedOther.isSetVoucher());
12550
      if (lastComparison != 0) {
12551
        return lastComparison;
12552
      }
12553
      if (isSetVoucher()) {
12554
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.voucher, typedOther.voucher);
12555
        if (lastComparison != 0) {
12556
          return lastComparison;
12557
        }
12558
      }
12559
      return 0;
12560
    }
12561
 
12562
    public _Fields fieldForId(int fieldId) {
12563
      return _Fields.findByThriftId(fieldId);
12564
    }
12565
 
12566
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
12567
      org.apache.thrift.protocol.TField field;
12568
      iprot.readStructBegin();
12569
      while (true)
12570
      {
12571
        field = iprot.readFieldBegin();
12572
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
12573
          break;
12574
        }
12575
        switch (field.id) {
12576
          case 1: // VOUCHER
12577
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
12578
              this.voucher = new Voucher();
12579
              this.voucher.read(iprot);
12580
            } else { 
12581
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12582
            }
12583
            break;
12584
          default:
12585
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12586
        }
12587
        iprot.readFieldEnd();
12588
      }
12589
      iprot.readStructEnd();
12590
      validate();
12591
    }
12592
 
12593
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
12594
      validate();
12595
 
12596
      oprot.writeStructBegin(STRUCT_DESC);
12597
      if (this.voucher != null) {
12598
        oprot.writeFieldBegin(VOUCHER_FIELD_DESC);
12599
        this.voucher.write(oprot);
12600
        oprot.writeFieldEnd();
12601
      }
12602
      oprot.writeFieldStop();
12603
      oprot.writeStructEnd();
12604
    }
12605
 
12606
    @Override
12607
    public String toString() {
12608
      StringBuilder sb = new StringBuilder("addVoucher_args(");
12609
      boolean first = true;
12610
 
12611
      sb.append("voucher:");
12612
      if (this.voucher == null) {
12613
        sb.append("null");
12614
      } else {
12615
        sb.append(this.voucher);
12616
      }
12617
      first = false;
12618
      sb.append(")");
12619
      return sb.toString();
12620
    }
12621
 
12622
    public void validate() throws org.apache.thrift.TException {
12623
      // check for required fields
12624
    }
12625
 
12626
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
12627
      try {
12628
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
12629
      } catch (org.apache.thrift.TException te) {
12630
        throw new java.io.IOException(te);
12631
      }
12632
    }
12633
 
12634
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
12635
      try {
12636
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
12637
      } catch (org.apache.thrift.TException te) {
12638
        throw new java.io.IOException(te);
12639
      }
12640
    }
12641
 
12642
  }
12643
 
12644
  public static class addVoucher_result implements org.apache.thrift.TBase<addVoucher_result, addVoucher_result._Fields>, java.io.Serializable, Cloneable   {
12645
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addVoucher_result");
12646
 
12647
 
12648
 
12649
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
12650
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
12651
;
12652
 
12653
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
12654
 
12655
      static {
12656
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
12657
          byName.put(field.getFieldName(), field);
12658
        }
12659
      }
12660
 
12661
      /**
12662
       * Find the _Fields constant that matches fieldId, or null if its not found.
12663
       */
12664
      public static _Fields findByThriftId(int fieldId) {
12665
        switch(fieldId) {
12666
          default:
12667
            return null;
12668
        }
12669
      }
12670
 
12671
      /**
12672
       * Find the _Fields constant that matches fieldId, throwing an exception
12673
       * if it is not found.
12674
       */
12675
      public static _Fields findByThriftIdOrThrow(int fieldId) {
12676
        _Fields fields = findByThriftId(fieldId);
12677
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
12678
        return fields;
12679
      }
12680
 
12681
      /**
12682
       * Find the _Fields constant that matches name, or null if its not found.
12683
       */
12684
      public static _Fields findByName(String name) {
12685
        return byName.get(name);
12686
      }
12687
 
12688
      private final short _thriftId;
12689
      private final String _fieldName;
12690
 
12691
      _Fields(short thriftId, String fieldName) {
12692
        _thriftId = thriftId;
12693
        _fieldName = fieldName;
12694
      }
12695
 
12696
      public short getThriftFieldId() {
12697
        return _thriftId;
12698
      }
12699
 
12700
      public String getFieldName() {
12701
        return _fieldName;
12702
      }
12703
    }
12704
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
12705
    static {
12706
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
12707
      metaDataMap = Collections.unmodifiableMap(tmpMap);
12708
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addVoucher_result.class, metaDataMap);
12709
    }
12710
 
12711
    public addVoucher_result() {
12712
    }
12713
 
12714
    /**
12715
     * Performs a deep copy on <i>other</i>.
12716
     */
12717
    public addVoucher_result(addVoucher_result other) {
12718
    }
12719
 
12720
    public addVoucher_result deepCopy() {
12721
      return new addVoucher_result(this);
12722
    }
12723
 
12724
    @Override
12725
    public void clear() {
12726
    }
12727
 
12728
    public void setFieldValue(_Fields field, Object value) {
12729
      switch (field) {
12730
      }
12731
    }
12732
 
12733
    public Object getFieldValue(_Fields field) {
12734
      switch (field) {
12735
      }
12736
      throw new IllegalStateException();
12737
    }
12738
 
12739
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
12740
    public boolean isSet(_Fields field) {
12741
      if (field == null) {
12742
        throw new IllegalArgumentException();
12743
      }
12744
 
12745
      switch (field) {
12746
      }
12747
      throw new IllegalStateException();
12748
    }
12749
 
12750
    @Override
12751
    public boolean equals(Object that) {
12752
      if (that == null)
12753
        return false;
12754
      if (that instanceof addVoucher_result)
12755
        return this.equals((addVoucher_result)that);
12756
      return false;
12757
    }
12758
 
12759
    public boolean equals(addVoucher_result that) {
12760
      if (that == null)
12761
        return false;
12762
 
12763
      return true;
12764
    }
12765
 
12766
    @Override
12767
    public int hashCode() {
12768
      return 0;
12769
    }
12770
 
12771
    public int compareTo(addVoucher_result other) {
12772
      if (!getClass().equals(other.getClass())) {
12773
        return getClass().getName().compareTo(other.getClass().getName());
12774
      }
12775
 
12776
      int lastComparison = 0;
12777
      addVoucher_result typedOther = (addVoucher_result)other;
12778
 
12779
      return 0;
12780
    }
12781
 
12782
    public _Fields fieldForId(int fieldId) {
12783
      return _Fields.findByThriftId(fieldId);
12784
    }
12785
 
12786
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
12787
      org.apache.thrift.protocol.TField field;
12788
      iprot.readStructBegin();
12789
      while (true)
12790
      {
12791
        field = iprot.readFieldBegin();
12792
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
12793
          break;
12794
        }
12795
        switch (field.id) {
12796
          default:
12797
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12798
        }
12799
        iprot.readFieldEnd();
12800
      }
12801
      iprot.readStructEnd();
12802
      validate();
12803
    }
12804
 
12805
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
12806
      oprot.writeStructBegin(STRUCT_DESC);
12807
 
12808
      oprot.writeFieldStop();
12809
      oprot.writeStructEnd();
12810
    }
12811
 
12812
    @Override
12813
    public String toString() {
12814
      StringBuilder sb = new StringBuilder("addVoucher_result(");
12815
      boolean first = true;
12816
 
12817
      sb.append(")");
12818
      return sb.toString();
12819
    }
12820
 
12821
    public void validate() throws org.apache.thrift.TException {
12822
      // check for required fields
12823
    }
12824
 
12825
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
12826
      try {
12827
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
12828
      } catch (org.apache.thrift.TException te) {
12829
        throw new java.io.IOException(te);
12830
      }
12831
    }
12832
 
12833
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
12834
      try {
12835
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
12836
      } catch (org.apache.thrift.TException te) {
12837
        throw new java.io.IOException(te);
12838
      }
12839
    }
12840
 
12841
  }
12842
 
12843
  public static class assignVoucher_args implements org.apache.thrift.TBase<assignVoucher_args, assignVoucher_args._Fields>, java.io.Serializable, Cloneable   {
12844
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("assignVoucher_args");
12845
 
12846
    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);
12847
    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);
12848
    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);
12849
    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);
12850
 
12851
    private long userId; // required
12852
    private String userEmail; // required
12853
    private VoucherType voucherType; // required
12854
    private long amount; // required
12855
 
12856
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
12857
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
12858
      USER_ID((short)1, "userId"),
12859
      USER_EMAIL((short)2, "userEmail"),
12860
      /**
12861
       * 
12862
       * @see VoucherType
12863
       */
12864
      VOUCHER_TYPE((short)3, "voucherType"),
12865
      AMOUNT((short)4, "amount");
12866
 
12867
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
12868
 
12869
      static {
12870
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
12871
          byName.put(field.getFieldName(), field);
12872
        }
12873
      }
12874
 
12875
      /**
12876
       * Find the _Fields constant that matches fieldId, or null if its not found.
12877
       */
12878
      public static _Fields findByThriftId(int fieldId) {
12879
        switch(fieldId) {
12880
          case 1: // USER_ID
12881
            return USER_ID;
12882
          case 2: // USER_EMAIL
12883
            return USER_EMAIL;
12884
          case 3: // VOUCHER_TYPE
12885
            return VOUCHER_TYPE;
12886
          case 4: // AMOUNT
12887
            return AMOUNT;
12888
          default:
12889
            return null;
12890
        }
12891
      }
12892
 
12893
      /**
12894
       * Find the _Fields constant that matches fieldId, throwing an exception
12895
       * if it is not found.
12896
       */
12897
      public static _Fields findByThriftIdOrThrow(int fieldId) {
12898
        _Fields fields = findByThriftId(fieldId);
12899
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
12900
        return fields;
12901
      }
12902
 
12903
      /**
12904
       * Find the _Fields constant that matches name, or null if its not found.
12905
       */
12906
      public static _Fields findByName(String name) {
12907
        return byName.get(name);
12908
      }
12909
 
12910
      private final short _thriftId;
12911
      private final String _fieldName;
12912
 
12913
      _Fields(short thriftId, String fieldName) {
12914
        _thriftId = thriftId;
12915
        _fieldName = fieldName;
12916
      }
12917
 
12918
      public short getThriftFieldId() {
12919
        return _thriftId;
12920
      }
12921
 
12922
      public String getFieldName() {
12923
        return _fieldName;
12924
      }
12925
    }
12926
 
12927
    // isset id assignments
12928
    private static final int __USERID_ISSET_ID = 0;
12929
    private static final int __AMOUNT_ISSET_ID = 1;
12930
    private BitSet __isset_bit_vector = new BitSet(2);
12931
 
12932
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
12933
    static {
12934
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
12935
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12936
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
12937
      tmpMap.put(_Fields.USER_EMAIL, new org.apache.thrift.meta_data.FieldMetaData("userEmail", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12938
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
12939
      tmpMap.put(_Fields.VOUCHER_TYPE, new org.apache.thrift.meta_data.FieldMetaData("voucherType", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12940
          new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, VoucherType.class)));
12941
      tmpMap.put(_Fields.AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("amount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12942
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
12943
      metaDataMap = Collections.unmodifiableMap(tmpMap);
12944
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(assignVoucher_args.class, metaDataMap);
12945
    }
12946
 
12947
    public assignVoucher_args() {
12948
    }
12949
 
12950
    public assignVoucher_args(
12951
      long userId,
12952
      String userEmail,
12953
      VoucherType voucherType,
12954
      long amount)
12955
    {
12956
      this();
12957
      this.userId = userId;
12958
      setUserIdIsSet(true);
12959
      this.userEmail = userEmail;
12960
      this.voucherType = voucherType;
12961
      this.amount = amount;
12962
      setAmountIsSet(true);
12963
    }
12964
 
12965
    /**
12966
     * Performs a deep copy on <i>other</i>.
12967
     */
12968
    public assignVoucher_args(assignVoucher_args other) {
12969
      __isset_bit_vector.clear();
12970
      __isset_bit_vector.or(other.__isset_bit_vector);
12971
      this.userId = other.userId;
12972
      if (other.isSetUserEmail()) {
12973
        this.userEmail = other.userEmail;
12974
      }
12975
      if (other.isSetVoucherType()) {
12976
        this.voucherType = other.voucherType;
12977
      }
12978
      this.amount = other.amount;
12979
    }
12980
 
12981
    public assignVoucher_args deepCopy() {
12982
      return new assignVoucher_args(this);
12983
    }
12984
 
12985
    @Override
12986
    public void clear() {
12987
      setUserIdIsSet(false);
12988
      this.userId = 0;
12989
      this.userEmail = null;
12990
      this.voucherType = null;
12991
      setAmountIsSet(false);
12992
      this.amount = 0;
12993
    }
12994
 
12995
    public long getUserId() {
12996
      return this.userId;
12997
    }
12998
 
12999
    public void setUserId(long userId) {
13000
      this.userId = userId;
13001
      setUserIdIsSet(true);
13002
    }
13003
 
13004
    public void unsetUserId() {
13005
      __isset_bit_vector.clear(__USERID_ISSET_ID);
13006
    }
13007
 
13008
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
13009
    public boolean isSetUserId() {
13010
      return __isset_bit_vector.get(__USERID_ISSET_ID);
13011
    }
13012
 
13013
    public void setUserIdIsSet(boolean value) {
13014
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
13015
    }
13016
 
13017
    public String getUserEmail() {
13018
      return this.userEmail;
13019
    }
13020
 
13021
    public void setUserEmail(String userEmail) {
13022
      this.userEmail = userEmail;
13023
    }
13024
 
13025
    public void unsetUserEmail() {
13026
      this.userEmail = null;
13027
    }
13028
 
13029
    /** Returns true if field userEmail is set (has been assigned a value) and false otherwise */
13030
    public boolean isSetUserEmail() {
13031
      return this.userEmail != null;
13032
    }
13033
 
13034
    public void setUserEmailIsSet(boolean value) {
13035
      if (!value) {
13036
        this.userEmail = null;
13037
      }
13038
    }
13039
 
13040
    /**
13041
     * 
13042
     * @see VoucherType
13043
     */
13044
    public VoucherType getVoucherType() {
13045
      return this.voucherType;
13046
    }
13047
 
13048
    /**
13049
     * 
13050
     * @see VoucherType
13051
     */
13052
    public void setVoucherType(VoucherType voucherType) {
13053
      this.voucherType = voucherType;
13054
    }
13055
 
13056
    public void unsetVoucherType() {
13057
      this.voucherType = null;
13058
    }
13059
 
13060
    /** Returns true if field voucherType is set (has been assigned a value) and false otherwise */
13061
    public boolean isSetVoucherType() {
13062
      return this.voucherType != null;
13063
    }
13064
 
13065
    public void setVoucherTypeIsSet(boolean value) {
13066
      if (!value) {
13067
        this.voucherType = null;
13068
      }
13069
    }
13070
 
13071
    public long getAmount() {
13072
      return this.amount;
13073
    }
13074
 
13075
    public void setAmount(long amount) {
13076
      this.amount = amount;
13077
      setAmountIsSet(true);
13078
    }
13079
 
13080
    public void unsetAmount() {
13081
      __isset_bit_vector.clear(__AMOUNT_ISSET_ID);
13082
    }
13083
 
13084
    /** Returns true if field amount is set (has been assigned a value) and false otherwise */
13085
    public boolean isSetAmount() {
13086
      return __isset_bit_vector.get(__AMOUNT_ISSET_ID);
13087
    }
13088
 
13089
    public void setAmountIsSet(boolean value) {
13090
      __isset_bit_vector.set(__AMOUNT_ISSET_ID, value);
13091
    }
13092
 
13093
    public void setFieldValue(_Fields field, Object value) {
13094
      switch (field) {
13095
      case USER_ID:
13096
        if (value == null) {
13097
          unsetUserId();
13098
        } else {
13099
          setUserId((Long)value);
13100
        }
13101
        break;
13102
 
13103
      case USER_EMAIL:
13104
        if (value == null) {
13105
          unsetUserEmail();
13106
        } else {
13107
          setUserEmail((String)value);
13108
        }
13109
        break;
13110
 
13111
      case VOUCHER_TYPE:
13112
        if (value == null) {
13113
          unsetVoucherType();
13114
        } else {
13115
          setVoucherType((VoucherType)value);
13116
        }
13117
        break;
13118
 
13119
      case AMOUNT:
13120
        if (value == null) {
13121
          unsetAmount();
13122
        } else {
13123
          setAmount((Long)value);
13124
        }
13125
        break;
13126
 
13127
      }
13128
    }
13129
 
13130
    public Object getFieldValue(_Fields field) {
13131
      switch (field) {
13132
      case USER_ID:
13133
        return Long.valueOf(getUserId());
13134
 
13135
      case USER_EMAIL:
13136
        return getUserEmail();
13137
 
13138
      case VOUCHER_TYPE:
13139
        return getVoucherType();
13140
 
13141
      case AMOUNT:
13142
        return Long.valueOf(getAmount());
13143
 
13144
      }
13145
      throw new IllegalStateException();
13146
    }
13147
 
13148
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
13149
    public boolean isSet(_Fields field) {
13150
      if (field == null) {
13151
        throw new IllegalArgumentException();
13152
      }
13153
 
13154
      switch (field) {
13155
      case USER_ID:
13156
        return isSetUserId();
13157
      case USER_EMAIL:
13158
        return isSetUserEmail();
13159
      case VOUCHER_TYPE:
13160
        return isSetVoucherType();
13161
      case AMOUNT:
13162
        return isSetAmount();
13163
      }
13164
      throw new IllegalStateException();
13165
    }
13166
 
13167
    @Override
13168
    public boolean equals(Object that) {
13169
      if (that == null)
13170
        return false;
13171
      if (that instanceof assignVoucher_args)
13172
        return this.equals((assignVoucher_args)that);
13173
      return false;
13174
    }
13175
 
13176
    public boolean equals(assignVoucher_args that) {
13177
      if (that == null)
13178
        return false;
13179
 
13180
      boolean this_present_userId = true;
13181
      boolean that_present_userId = true;
13182
      if (this_present_userId || that_present_userId) {
13183
        if (!(this_present_userId && that_present_userId))
13184
          return false;
13185
        if (this.userId != that.userId)
13186
          return false;
13187
      }
13188
 
13189
      boolean this_present_userEmail = true && this.isSetUserEmail();
13190
      boolean that_present_userEmail = true && that.isSetUserEmail();
13191
      if (this_present_userEmail || that_present_userEmail) {
13192
        if (!(this_present_userEmail && that_present_userEmail))
13193
          return false;
13194
        if (!this.userEmail.equals(that.userEmail))
13195
          return false;
13196
      }
13197
 
13198
      boolean this_present_voucherType = true && this.isSetVoucherType();
13199
      boolean that_present_voucherType = true && that.isSetVoucherType();
13200
      if (this_present_voucherType || that_present_voucherType) {
13201
        if (!(this_present_voucherType && that_present_voucherType))
13202
          return false;
13203
        if (!this.voucherType.equals(that.voucherType))
13204
          return false;
13205
      }
13206
 
13207
      boolean this_present_amount = true;
13208
      boolean that_present_amount = true;
13209
      if (this_present_amount || that_present_amount) {
13210
        if (!(this_present_amount && that_present_amount))
13211
          return false;
13212
        if (this.amount != that.amount)
13213
          return false;
13214
      }
13215
 
13216
      return true;
13217
    }
13218
 
13219
    @Override
13220
    public int hashCode() {
13221
      return 0;
13222
    }
13223
 
13224
    public int compareTo(assignVoucher_args other) {
13225
      if (!getClass().equals(other.getClass())) {
13226
        return getClass().getName().compareTo(other.getClass().getName());
13227
      }
13228
 
13229
      int lastComparison = 0;
13230
      assignVoucher_args typedOther = (assignVoucher_args)other;
13231
 
13232
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
13233
      if (lastComparison != 0) {
13234
        return lastComparison;
13235
      }
13236
      if (isSetUserId()) {
13237
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
13238
        if (lastComparison != 0) {
13239
          return lastComparison;
13240
        }
13241
      }
13242
      lastComparison = Boolean.valueOf(isSetUserEmail()).compareTo(typedOther.isSetUserEmail());
13243
      if (lastComparison != 0) {
13244
        return lastComparison;
13245
      }
13246
      if (isSetUserEmail()) {
13247
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userEmail, typedOther.userEmail);
13248
        if (lastComparison != 0) {
13249
          return lastComparison;
13250
        }
13251
      }
13252
      lastComparison = Boolean.valueOf(isSetVoucherType()).compareTo(typedOther.isSetVoucherType());
13253
      if (lastComparison != 0) {
13254
        return lastComparison;
13255
      }
13256
      if (isSetVoucherType()) {
13257
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.voucherType, typedOther.voucherType);
13258
        if (lastComparison != 0) {
13259
          return lastComparison;
13260
        }
13261
      }
13262
      lastComparison = Boolean.valueOf(isSetAmount()).compareTo(typedOther.isSetAmount());
13263
      if (lastComparison != 0) {
13264
        return lastComparison;
13265
      }
13266
      if (isSetAmount()) {
13267
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.amount, typedOther.amount);
13268
        if (lastComparison != 0) {
13269
          return lastComparison;
13270
        }
13271
      }
13272
      return 0;
13273
    }
13274
 
13275
    public _Fields fieldForId(int fieldId) {
13276
      return _Fields.findByThriftId(fieldId);
13277
    }
13278
 
13279
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
13280
      org.apache.thrift.protocol.TField field;
13281
      iprot.readStructBegin();
13282
      while (true)
13283
      {
13284
        field = iprot.readFieldBegin();
13285
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
13286
          break;
13287
        }
13288
        switch (field.id) {
13289
          case 1: // USER_ID
13290
            if (field.type == org.apache.thrift.protocol.TType.I64) {
13291
              this.userId = iprot.readI64();
13292
              setUserIdIsSet(true);
13293
            } else { 
13294
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13295
            }
13296
            break;
13297
          case 2: // USER_EMAIL
13298
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
13299
              this.userEmail = iprot.readString();
13300
            } else { 
13301
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13302
            }
13303
            break;
13304
          case 3: // VOUCHER_TYPE
13305
            if (field.type == org.apache.thrift.protocol.TType.I32) {
13306
              this.voucherType = VoucherType.findByValue(iprot.readI32());
13307
            } else { 
13308
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13309
            }
13310
            break;
13311
          case 4: // AMOUNT
13312
            if (field.type == org.apache.thrift.protocol.TType.I64) {
13313
              this.amount = iprot.readI64();
13314
              setAmountIsSet(true);
13315
            } else { 
13316
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13317
            }
13318
            break;
13319
          default:
13320
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13321
        }
13322
        iprot.readFieldEnd();
13323
      }
13324
      iprot.readStructEnd();
13325
      validate();
13326
    }
13327
 
13328
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
13329
      validate();
13330
 
13331
      oprot.writeStructBegin(STRUCT_DESC);
13332
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
13333
      oprot.writeI64(this.userId);
13334
      oprot.writeFieldEnd();
13335
      if (this.userEmail != null) {
13336
        oprot.writeFieldBegin(USER_EMAIL_FIELD_DESC);
13337
        oprot.writeString(this.userEmail);
13338
        oprot.writeFieldEnd();
13339
      }
13340
      if (this.voucherType != null) {
13341
        oprot.writeFieldBegin(VOUCHER_TYPE_FIELD_DESC);
13342
        oprot.writeI32(this.voucherType.getValue());
13343
        oprot.writeFieldEnd();
13344
      }
13345
      oprot.writeFieldBegin(AMOUNT_FIELD_DESC);
13346
      oprot.writeI64(this.amount);
13347
      oprot.writeFieldEnd();
13348
      oprot.writeFieldStop();
13349
      oprot.writeStructEnd();
13350
    }
13351
 
13352
    @Override
13353
    public String toString() {
13354
      StringBuilder sb = new StringBuilder("assignVoucher_args(");
13355
      boolean first = true;
13356
 
13357
      sb.append("userId:");
13358
      sb.append(this.userId);
13359
      first = false;
13360
      if (!first) sb.append(", ");
13361
      sb.append("userEmail:");
13362
      if (this.userEmail == null) {
13363
        sb.append("null");
13364
      } else {
13365
        sb.append(this.userEmail);
13366
      }
13367
      first = false;
13368
      if (!first) sb.append(", ");
13369
      sb.append("voucherType:");
13370
      if (this.voucherType == null) {
13371
        sb.append("null");
13372
      } else {
13373
        sb.append(this.voucherType);
13374
      }
13375
      first = false;
13376
      if (!first) sb.append(", ");
13377
      sb.append("amount:");
13378
      sb.append(this.amount);
13379
      first = false;
13380
      sb.append(")");
13381
      return sb.toString();
13382
    }
13383
 
13384
    public void validate() throws org.apache.thrift.TException {
13385
      // check for required fields
13386
    }
13387
 
13388
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
13389
      try {
13390
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
13391
      } catch (org.apache.thrift.TException te) {
13392
        throw new java.io.IOException(te);
13393
      }
13394
    }
13395
 
13396
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
13397
      try {
13398
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
13399
        __isset_bit_vector = new BitSet(1);
13400
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
13401
      } catch (org.apache.thrift.TException te) {
13402
        throw new java.io.IOException(te);
13403
      }
13404
    }
13405
 
13406
  }
13407
 
13408
  public static class assignVoucher_result implements org.apache.thrift.TBase<assignVoucher_result, assignVoucher_result._Fields>, java.io.Serializable, Cloneable   {
13409
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("assignVoucher_result");
13410
 
13411
    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);
13412
 
13413
    private Voucher success; // required
13414
 
13415
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
13416
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
13417
      SUCCESS((short)0, "success");
13418
 
13419
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
13420
 
13421
      static {
13422
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
13423
          byName.put(field.getFieldName(), field);
13424
        }
13425
      }
13426
 
13427
      /**
13428
       * Find the _Fields constant that matches fieldId, or null if its not found.
13429
       */
13430
      public static _Fields findByThriftId(int fieldId) {
13431
        switch(fieldId) {
13432
          case 0: // SUCCESS
13433
            return SUCCESS;
13434
          default:
13435
            return null;
13436
        }
13437
      }
13438
 
13439
      /**
13440
       * Find the _Fields constant that matches fieldId, throwing an exception
13441
       * if it is not found.
13442
       */
13443
      public static _Fields findByThriftIdOrThrow(int fieldId) {
13444
        _Fields fields = findByThriftId(fieldId);
13445
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
13446
        return fields;
13447
      }
13448
 
13449
      /**
13450
       * Find the _Fields constant that matches name, or null if its not found.
13451
       */
13452
      public static _Fields findByName(String name) {
13453
        return byName.get(name);
13454
      }
13455
 
13456
      private final short _thriftId;
13457
      private final String _fieldName;
13458
 
13459
      _Fields(short thriftId, String fieldName) {
13460
        _thriftId = thriftId;
13461
        _fieldName = fieldName;
13462
      }
13463
 
13464
      public short getThriftFieldId() {
13465
        return _thriftId;
13466
      }
13467
 
13468
      public String getFieldName() {
13469
        return _fieldName;
13470
      }
13471
    }
13472
 
13473
    // isset id assignments
13474
 
13475
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
13476
    static {
13477
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
13478
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
13479
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Voucher.class)));
13480
      metaDataMap = Collections.unmodifiableMap(tmpMap);
13481
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(assignVoucher_result.class, metaDataMap);
13482
    }
13483
 
13484
    public assignVoucher_result() {
13485
    }
13486
 
13487
    public assignVoucher_result(
13488
      Voucher success)
13489
    {
13490
      this();
13491
      this.success = success;
13492
    }
13493
 
13494
    /**
13495
     * Performs a deep copy on <i>other</i>.
13496
     */
13497
    public assignVoucher_result(assignVoucher_result other) {
13498
      if (other.isSetSuccess()) {
13499
        this.success = new Voucher(other.success);
13500
      }
13501
    }
13502
 
13503
    public assignVoucher_result deepCopy() {
13504
      return new assignVoucher_result(this);
13505
    }
13506
 
13507
    @Override
13508
    public void clear() {
13509
      this.success = null;
13510
    }
13511
 
13512
    public Voucher getSuccess() {
13513
      return this.success;
13514
    }
13515
 
13516
    public void setSuccess(Voucher success) {
13517
      this.success = success;
13518
    }
13519
 
13520
    public void unsetSuccess() {
13521
      this.success = null;
13522
    }
13523
 
13524
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
13525
    public boolean isSetSuccess() {
13526
      return this.success != null;
13527
    }
13528
 
13529
    public void setSuccessIsSet(boolean value) {
13530
      if (!value) {
13531
        this.success = null;
13532
      }
13533
    }
13534
 
13535
    public void setFieldValue(_Fields field, Object value) {
13536
      switch (field) {
13537
      case SUCCESS:
13538
        if (value == null) {
13539
          unsetSuccess();
13540
        } else {
13541
          setSuccess((Voucher)value);
13542
        }
13543
        break;
13544
 
13545
      }
13546
    }
13547
 
13548
    public Object getFieldValue(_Fields field) {
13549
      switch (field) {
13550
      case SUCCESS:
13551
        return getSuccess();
13552
 
13553
      }
13554
      throw new IllegalStateException();
13555
    }
13556
 
13557
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
13558
    public boolean isSet(_Fields field) {
13559
      if (field == null) {
13560
        throw new IllegalArgumentException();
13561
      }
13562
 
13563
      switch (field) {
13564
      case SUCCESS:
13565
        return isSetSuccess();
13566
      }
13567
      throw new IllegalStateException();
13568
    }
13569
 
13570
    @Override
13571
    public boolean equals(Object that) {
13572
      if (that == null)
13573
        return false;
13574
      if (that instanceof assignVoucher_result)
13575
        return this.equals((assignVoucher_result)that);
13576
      return false;
13577
    }
13578
 
13579
    public boolean equals(assignVoucher_result that) {
13580
      if (that == null)
13581
        return false;
13582
 
13583
      boolean this_present_success = true && this.isSetSuccess();
13584
      boolean that_present_success = true && that.isSetSuccess();
13585
      if (this_present_success || that_present_success) {
13586
        if (!(this_present_success && that_present_success))
13587
          return false;
13588
        if (!this.success.equals(that.success))
13589
          return false;
13590
      }
13591
 
13592
      return true;
13593
    }
13594
 
13595
    @Override
13596
    public int hashCode() {
13597
      return 0;
13598
    }
13599
 
13600
    public int compareTo(assignVoucher_result other) {
13601
      if (!getClass().equals(other.getClass())) {
13602
        return getClass().getName().compareTo(other.getClass().getName());
13603
      }
13604
 
13605
      int lastComparison = 0;
13606
      assignVoucher_result typedOther = (assignVoucher_result)other;
13607
 
13608
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
13609
      if (lastComparison != 0) {
13610
        return lastComparison;
13611
      }
13612
      if (isSetSuccess()) {
13613
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
13614
        if (lastComparison != 0) {
13615
          return lastComparison;
13616
        }
13617
      }
13618
      return 0;
13619
    }
13620
 
13621
    public _Fields fieldForId(int fieldId) {
13622
      return _Fields.findByThriftId(fieldId);
13623
    }
13624
 
13625
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
13626
      org.apache.thrift.protocol.TField field;
13627
      iprot.readStructBegin();
13628
      while (true)
13629
      {
13630
        field = iprot.readFieldBegin();
13631
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
13632
          break;
13633
        }
13634
        switch (field.id) {
13635
          case 0: // SUCCESS
13636
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
13637
              this.success = new Voucher();
13638
              this.success.read(iprot);
13639
            } else { 
13640
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13641
            }
13642
            break;
13643
          default:
13644
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13645
        }
13646
        iprot.readFieldEnd();
13647
      }
13648
      iprot.readStructEnd();
13649
      validate();
13650
    }
13651
 
13652
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
13653
      oprot.writeStructBegin(STRUCT_DESC);
13654
 
13655
      if (this.isSetSuccess()) {
13656
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
13657
        this.success.write(oprot);
13658
        oprot.writeFieldEnd();
13659
      }
13660
      oprot.writeFieldStop();
13661
      oprot.writeStructEnd();
13662
    }
13663
 
13664
    @Override
13665
    public String toString() {
13666
      StringBuilder sb = new StringBuilder("assignVoucher_result(");
13667
      boolean first = true;
13668
 
13669
      sb.append("success:");
13670
      if (this.success == null) {
13671
        sb.append("null");
13672
      } else {
13673
        sb.append(this.success);
13674
      }
13675
      first = false;
13676
      sb.append(")");
13677
      return sb.toString();
13678
    }
13679
 
13680
    public void validate() throws org.apache.thrift.TException {
13681
      // check for required fields
13682
    }
13683
 
13684
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
13685
      try {
13686
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
13687
      } catch (org.apache.thrift.TException te) {
13688
        throw new java.io.IOException(te);
13689
      }
13690
    }
13691
 
13692
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
13693
      try {
13694
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
13695
      } catch (org.apache.thrift.TException te) {
13696
        throw new java.io.IOException(te);
13697
      }
13698
    }
13699
 
13700
  }
13701
 
13702
  public static class markVoucherAsRedeemed_args implements org.apache.thrift.TBase<markVoucherAsRedeemed_args, markVoucherAsRedeemed_args._Fields>, java.io.Serializable, Cloneable   {
13703
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("markVoucherAsRedeemed_args");
13704
 
13705
    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);
13706
    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);
13707
 
13708
    private String voucherCode; // required
13709
    private long redeemedOn; // required
13710
 
13711
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
13712
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
13713
      VOUCHER_CODE((short)1, "voucherCode"),
13714
      REDEEMED_ON((short)2, "redeemedOn");
13715
 
13716
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
13717
 
13718
      static {
13719
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
13720
          byName.put(field.getFieldName(), field);
13721
        }
13722
      }
13723
 
13724
      /**
13725
       * Find the _Fields constant that matches fieldId, or null if its not found.
13726
       */
13727
      public static _Fields findByThriftId(int fieldId) {
13728
        switch(fieldId) {
13729
          case 1: // VOUCHER_CODE
13730
            return VOUCHER_CODE;
13731
          case 2: // REDEEMED_ON
13732
            return REDEEMED_ON;
13733
          default:
13734
            return null;
13735
        }
13736
      }
13737
 
13738
      /**
13739
       * Find the _Fields constant that matches fieldId, throwing an exception
13740
       * if it is not found.
13741
       */
13742
      public static _Fields findByThriftIdOrThrow(int fieldId) {
13743
        _Fields fields = findByThriftId(fieldId);
13744
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
13745
        return fields;
13746
      }
13747
 
13748
      /**
13749
       * Find the _Fields constant that matches name, or null if its not found.
13750
       */
13751
      public static _Fields findByName(String name) {
13752
        return byName.get(name);
13753
      }
13754
 
13755
      private final short _thriftId;
13756
      private final String _fieldName;
13757
 
13758
      _Fields(short thriftId, String fieldName) {
13759
        _thriftId = thriftId;
13760
        _fieldName = fieldName;
13761
      }
13762
 
13763
      public short getThriftFieldId() {
13764
        return _thriftId;
13765
      }
13766
 
13767
      public String getFieldName() {
13768
        return _fieldName;
13769
      }
13770
    }
13771
 
13772
    // isset id assignments
13773
    private static final int __REDEEMEDON_ISSET_ID = 0;
13774
    private BitSet __isset_bit_vector = new BitSet(1);
13775
 
13776
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
13777
    static {
13778
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
13779
      tmpMap.put(_Fields.VOUCHER_CODE, new org.apache.thrift.meta_data.FieldMetaData("voucherCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
13780
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
13781
      tmpMap.put(_Fields.REDEEMED_ON, new org.apache.thrift.meta_data.FieldMetaData("redeemedOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
13782
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
13783
      metaDataMap = Collections.unmodifiableMap(tmpMap);
13784
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(markVoucherAsRedeemed_args.class, metaDataMap);
13785
    }
13786
 
13787
    public markVoucherAsRedeemed_args() {
13788
    }
13789
 
13790
    public markVoucherAsRedeemed_args(
13791
      String voucherCode,
13792
      long redeemedOn)
13793
    {
13794
      this();
13795
      this.voucherCode = voucherCode;
13796
      this.redeemedOn = redeemedOn;
13797
      setRedeemedOnIsSet(true);
13798
    }
13799
 
13800
    /**
13801
     * Performs a deep copy on <i>other</i>.
13802
     */
13803
    public markVoucherAsRedeemed_args(markVoucherAsRedeemed_args other) {
13804
      __isset_bit_vector.clear();
13805
      __isset_bit_vector.or(other.__isset_bit_vector);
13806
      if (other.isSetVoucherCode()) {
13807
        this.voucherCode = other.voucherCode;
13808
      }
13809
      this.redeemedOn = other.redeemedOn;
13810
    }
13811
 
13812
    public markVoucherAsRedeemed_args deepCopy() {
13813
      return new markVoucherAsRedeemed_args(this);
13814
    }
13815
 
13816
    @Override
13817
    public void clear() {
13818
      this.voucherCode = null;
13819
      setRedeemedOnIsSet(false);
13820
      this.redeemedOn = 0;
13821
    }
13822
 
13823
    public String getVoucherCode() {
13824
      return this.voucherCode;
13825
    }
13826
 
13827
    public void setVoucherCode(String voucherCode) {
13828
      this.voucherCode = voucherCode;
13829
    }
13830
 
13831
    public void unsetVoucherCode() {
13832
      this.voucherCode = null;
13833
    }
13834
 
13835
    /** Returns true if field voucherCode is set (has been assigned a value) and false otherwise */
13836
    public boolean isSetVoucherCode() {
13837
      return this.voucherCode != null;
13838
    }
13839
 
13840
    public void setVoucherCodeIsSet(boolean value) {
13841
      if (!value) {
13842
        this.voucherCode = null;
13843
      }
13844
    }
13845
 
13846
    public long getRedeemedOn() {
13847
      return this.redeemedOn;
13848
    }
13849
 
13850
    public void setRedeemedOn(long redeemedOn) {
13851
      this.redeemedOn = redeemedOn;
13852
      setRedeemedOnIsSet(true);
13853
    }
13854
 
13855
    public void unsetRedeemedOn() {
13856
      __isset_bit_vector.clear(__REDEEMEDON_ISSET_ID);
13857
    }
13858
 
13859
    /** Returns true if field redeemedOn is set (has been assigned a value) and false otherwise */
13860
    public boolean isSetRedeemedOn() {
13861
      return __isset_bit_vector.get(__REDEEMEDON_ISSET_ID);
13862
    }
13863
 
13864
    public void setRedeemedOnIsSet(boolean value) {
13865
      __isset_bit_vector.set(__REDEEMEDON_ISSET_ID, value);
13866
    }
13867
 
13868
    public void setFieldValue(_Fields field, Object value) {
13869
      switch (field) {
13870
      case VOUCHER_CODE:
13871
        if (value == null) {
13872
          unsetVoucherCode();
13873
        } else {
13874
          setVoucherCode((String)value);
13875
        }
13876
        break;
13877
 
13878
      case REDEEMED_ON:
13879
        if (value == null) {
13880
          unsetRedeemedOn();
13881
        } else {
13882
          setRedeemedOn((Long)value);
13883
        }
13884
        break;
13885
 
13886
      }
13887
    }
13888
 
13889
    public Object getFieldValue(_Fields field) {
13890
      switch (field) {
13891
      case VOUCHER_CODE:
13892
        return getVoucherCode();
13893
 
13894
      case REDEEMED_ON:
13895
        return Long.valueOf(getRedeemedOn());
13896
 
13897
      }
13898
      throw new IllegalStateException();
13899
    }
13900
 
13901
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
13902
    public boolean isSet(_Fields field) {
13903
      if (field == null) {
13904
        throw new IllegalArgumentException();
13905
      }
13906
 
13907
      switch (field) {
13908
      case VOUCHER_CODE:
13909
        return isSetVoucherCode();
13910
      case REDEEMED_ON:
13911
        return isSetRedeemedOn();
13912
      }
13913
      throw new IllegalStateException();
13914
    }
13915
 
13916
    @Override
13917
    public boolean equals(Object that) {
13918
      if (that == null)
13919
        return false;
13920
      if (that instanceof markVoucherAsRedeemed_args)
13921
        return this.equals((markVoucherAsRedeemed_args)that);
13922
      return false;
13923
    }
13924
 
13925
    public boolean equals(markVoucherAsRedeemed_args that) {
13926
      if (that == null)
13927
        return false;
13928
 
13929
      boolean this_present_voucherCode = true && this.isSetVoucherCode();
13930
      boolean that_present_voucherCode = true && that.isSetVoucherCode();
13931
      if (this_present_voucherCode || that_present_voucherCode) {
13932
        if (!(this_present_voucherCode && that_present_voucherCode))
13933
          return false;
13934
        if (!this.voucherCode.equals(that.voucherCode))
13935
          return false;
13936
      }
13937
 
13938
      boolean this_present_redeemedOn = true;
13939
      boolean that_present_redeemedOn = true;
13940
      if (this_present_redeemedOn || that_present_redeemedOn) {
13941
        if (!(this_present_redeemedOn && that_present_redeemedOn))
13942
          return false;
13943
        if (this.redeemedOn != that.redeemedOn)
13944
          return false;
13945
      }
13946
 
13947
      return true;
13948
    }
13949
 
13950
    @Override
13951
    public int hashCode() {
13952
      return 0;
13953
    }
13954
 
13955
    public int compareTo(markVoucherAsRedeemed_args other) {
13956
      if (!getClass().equals(other.getClass())) {
13957
        return getClass().getName().compareTo(other.getClass().getName());
13958
      }
13959
 
13960
      int lastComparison = 0;
13961
      markVoucherAsRedeemed_args typedOther = (markVoucherAsRedeemed_args)other;
13962
 
13963
      lastComparison = Boolean.valueOf(isSetVoucherCode()).compareTo(typedOther.isSetVoucherCode());
13964
      if (lastComparison != 0) {
13965
        return lastComparison;
13966
      }
13967
      if (isSetVoucherCode()) {
13968
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.voucherCode, typedOther.voucherCode);
13969
        if (lastComparison != 0) {
13970
          return lastComparison;
13971
        }
13972
      }
13973
      lastComparison = Boolean.valueOf(isSetRedeemedOn()).compareTo(typedOther.isSetRedeemedOn());
13974
      if (lastComparison != 0) {
13975
        return lastComparison;
13976
      }
13977
      if (isSetRedeemedOn()) {
13978
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.redeemedOn, typedOther.redeemedOn);
13979
        if (lastComparison != 0) {
13980
          return lastComparison;
13981
        }
13982
      }
13983
      return 0;
13984
    }
13985
 
13986
    public _Fields fieldForId(int fieldId) {
13987
      return _Fields.findByThriftId(fieldId);
13988
    }
13989
 
13990
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
13991
      org.apache.thrift.protocol.TField field;
13992
      iprot.readStructBegin();
13993
      while (true)
13994
      {
13995
        field = iprot.readFieldBegin();
13996
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
13997
          break;
13998
        }
13999
        switch (field.id) {
14000
          case 1: // VOUCHER_CODE
14001
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
14002
              this.voucherCode = iprot.readString();
14003
            } else { 
14004
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14005
            }
14006
            break;
14007
          case 2: // REDEEMED_ON
14008
            if (field.type == org.apache.thrift.protocol.TType.I64) {
14009
              this.redeemedOn = iprot.readI64();
14010
              setRedeemedOnIsSet(true);
14011
            } else { 
14012
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14013
            }
14014
            break;
14015
          default:
14016
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14017
        }
14018
        iprot.readFieldEnd();
14019
      }
14020
      iprot.readStructEnd();
14021
      validate();
14022
    }
14023
 
14024
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
14025
      validate();
14026
 
14027
      oprot.writeStructBegin(STRUCT_DESC);
14028
      if (this.voucherCode != null) {
14029
        oprot.writeFieldBegin(VOUCHER_CODE_FIELD_DESC);
14030
        oprot.writeString(this.voucherCode);
14031
        oprot.writeFieldEnd();
14032
      }
14033
      oprot.writeFieldBegin(REDEEMED_ON_FIELD_DESC);
14034
      oprot.writeI64(this.redeemedOn);
14035
      oprot.writeFieldEnd();
14036
      oprot.writeFieldStop();
14037
      oprot.writeStructEnd();
14038
    }
14039
 
14040
    @Override
14041
    public String toString() {
14042
      StringBuilder sb = new StringBuilder("markVoucherAsRedeemed_args(");
14043
      boolean first = true;
14044
 
14045
      sb.append("voucherCode:");
14046
      if (this.voucherCode == null) {
14047
        sb.append("null");
14048
      } else {
14049
        sb.append(this.voucherCode);
14050
      }
14051
      first = false;
14052
      if (!first) sb.append(", ");
14053
      sb.append("redeemedOn:");
14054
      sb.append(this.redeemedOn);
14055
      first = false;
14056
      sb.append(")");
14057
      return sb.toString();
14058
    }
14059
 
14060
    public void validate() throws org.apache.thrift.TException {
14061
      // check for required fields
14062
    }
14063
 
14064
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
14065
      try {
14066
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
14067
      } catch (org.apache.thrift.TException te) {
14068
        throw new java.io.IOException(te);
14069
      }
14070
    }
14071
 
14072
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
14073
      try {
14074
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
14075
        __isset_bit_vector = new BitSet(1);
14076
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
14077
      } catch (org.apache.thrift.TException te) {
14078
        throw new java.io.IOException(te);
14079
      }
14080
    }
14081
 
14082
  }
14083
 
14084
  public static class markVoucherAsRedeemed_result implements org.apache.thrift.TBase<markVoucherAsRedeemed_result, markVoucherAsRedeemed_result._Fields>, java.io.Serializable, Cloneable   {
14085
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("markVoucherAsRedeemed_result");
14086
 
14087
    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);
14088
 
14089
    private boolean success; // required
14090
 
14091
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
14092
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
14093
      SUCCESS((short)0, "success");
14094
 
14095
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
14096
 
14097
      static {
14098
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
14099
          byName.put(field.getFieldName(), field);
14100
        }
14101
      }
14102
 
14103
      /**
14104
       * Find the _Fields constant that matches fieldId, or null if its not found.
14105
       */
14106
      public static _Fields findByThriftId(int fieldId) {
14107
        switch(fieldId) {
14108
          case 0: // SUCCESS
14109
            return SUCCESS;
14110
          default:
14111
            return null;
14112
        }
14113
      }
14114
 
14115
      /**
14116
       * Find the _Fields constant that matches fieldId, throwing an exception
14117
       * if it is not found.
14118
       */
14119
      public static _Fields findByThriftIdOrThrow(int fieldId) {
14120
        _Fields fields = findByThriftId(fieldId);
14121
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
14122
        return fields;
14123
      }
14124
 
14125
      /**
14126
       * Find the _Fields constant that matches name, or null if its not found.
14127
       */
14128
      public static _Fields findByName(String name) {
14129
        return byName.get(name);
14130
      }
14131
 
14132
      private final short _thriftId;
14133
      private final String _fieldName;
14134
 
14135
      _Fields(short thriftId, String fieldName) {
14136
        _thriftId = thriftId;
14137
        _fieldName = fieldName;
14138
      }
14139
 
14140
      public short getThriftFieldId() {
14141
        return _thriftId;
14142
      }
14143
 
14144
      public String getFieldName() {
14145
        return _fieldName;
14146
      }
14147
    }
14148
 
14149
    // isset id assignments
14150
    private static final int __SUCCESS_ISSET_ID = 0;
14151
    private BitSet __isset_bit_vector = new BitSet(1);
14152
 
14153
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
14154
    static {
14155
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
14156
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14157
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
14158
      metaDataMap = Collections.unmodifiableMap(tmpMap);
14159
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(markVoucherAsRedeemed_result.class, metaDataMap);
14160
    }
14161
 
14162
    public markVoucherAsRedeemed_result() {
14163
    }
14164
 
14165
    public markVoucherAsRedeemed_result(
14166
      boolean success)
14167
    {
14168
      this();
14169
      this.success = success;
14170
      setSuccessIsSet(true);
14171
    }
14172
 
14173
    /**
14174
     * Performs a deep copy on <i>other</i>.
14175
     */
14176
    public markVoucherAsRedeemed_result(markVoucherAsRedeemed_result other) {
14177
      __isset_bit_vector.clear();
14178
      __isset_bit_vector.or(other.__isset_bit_vector);
14179
      this.success = other.success;
14180
    }
14181
 
14182
    public markVoucherAsRedeemed_result deepCopy() {
14183
      return new markVoucherAsRedeemed_result(this);
14184
    }
14185
 
14186
    @Override
14187
    public void clear() {
14188
      setSuccessIsSet(false);
14189
      this.success = false;
14190
    }
14191
 
14192
    public boolean isSuccess() {
14193
      return this.success;
14194
    }
14195
 
14196
    public void setSuccess(boolean success) {
14197
      this.success = success;
14198
      setSuccessIsSet(true);
14199
    }
14200
 
14201
    public void unsetSuccess() {
14202
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
14203
    }
14204
 
14205
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
14206
    public boolean isSetSuccess() {
14207
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
14208
    }
14209
 
14210
    public void setSuccessIsSet(boolean value) {
14211
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
14212
    }
14213
 
14214
    public void setFieldValue(_Fields field, Object value) {
14215
      switch (field) {
14216
      case SUCCESS:
14217
        if (value == null) {
14218
          unsetSuccess();
14219
        } else {
14220
          setSuccess((Boolean)value);
14221
        }
14222
        break;
14223
 
14224
      }
14225
    }
14226
 
14227
    public Object getFieldValue(_Fields field) {
14228
      switch (field) {
14229
      case SUCCESS:
14230
        return Boolean.valueOf(isSuccess());
14231
 
14232
      }
14233
      throw new IllegalStateException();
14234
    }
14235
 
14236
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
14237
    public boolean isSet(_Fields field) {
14238
      if (field == null) {
14239
        throw new IllegalArgumentException();
14240
      }
14241
 
14242
      switch (field) {
14243
      case SUCCESS:
14244
        return isSetSuccess();
14245
      }
14246
      throw new IllegalStateException();
14247
    }
14248
 
14249
    @Override
14250
    public boolean equals(Object that) {
14251
      if (that == null)
14252
        return false;
14253
      if (that instanceof markVoucherAsRedeemed_result)
14254
        return this.equals((markVoucherAsRedeemed_result)that);
14255
      return false;
14256
    }
14257
 
14258
    public boolean equals(markVoucherAsRedeemed_result that) {
14259
      if (that == null)
14260
        return false;
14261
 
14262
      boolean this_present_success = true;
14263
      boolean that_present_success = true;
14264
      if (this_present_success || that_present_success) {
14265
        if (!(this_present_success && that_present_success))
14266
          return false;
14267
        if (this.success != that.success)
14268
          return false;
14269
      }
14270
 
14271
      return true;
14272
    }
14273
 
14274
    @Override
14275
    public int hashCode() {
14276
      return 0;
14277
    }
14278
 
14279
    public int compareTo(markVoucherAsRedeemed_result other) {
14280
      if (!getClass().equals(other.getClass())) {
14281
        return getClass().getName().compareTo(other.getClass().getName());
14282
      }
14283
 
14284
      int lastComparison = 0;
14285
      markVoucherAsRedeemed_result typedOther = (markVoucherAsRedeemed_result)other;
14286
 
14287
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
14288
      if (lastComparison != 0) {
14289
        return lastComparison;
14290
      }
14291
      if (isSetSuccess()) {
14292
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
14293
        if (lastComparison != 0) {
14294
          return lastComparison;
14295
        }
14296
      }
14297
      return 0;
14298
    }
14299
 
14300
    public _Fields fieldForId(int fieldId) {
14301
      return _Fields.findByThriftId(fieldId);
14302
    }
14303
 
14304
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
14305
      org.apache.thrift.protocol.TField field;
14306
      iprot.readStructBegin();
14307
      while (true)
14308
      {
14309
        field = iprot.readFieldBegin();
14310
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
14311
          break;
14312
        }
14313
        switch (field.id) {
14314
          case 0: // SUCCESS
14315
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
14316
              this.success = iprot.readBool();
14317
              setSuccessIsSet(true);
14318
            } else { 
14319
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14320
            }
14321
            break;
14322
          default:
14323
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14324
        }
14325
        iprot.readFieldEnd();
14326
      }
14327
      iprot.readStructEnd();
14328
      validate();
14329
    }
14330
 
14331
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
14332
      oprot.writeStructBegin(STRUCT_DESC);
14333
 
14334
      if (this.isSetSuccess()) {
14335
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
14336
        oprot.writeBool(this.success);
14337
        oprot.writeFieldEnd();
14338
      }
14339
      oprot.writeFieldStop();
14340
      oprot.writeStructEnd();
14341
    }
14342
 
14343
    @Override
14344
    public String toString() {
14345
      StringBuilder sb = new StringBuilder("markVoucherAsRedeemed_result(");
14346
      boolean first = true;
14347
 
14348
      sb.append("success:");
14349
      sb.append(this.success);
14350
      first = false;
14351
      sb.append(")");
14352
      return sb.toString();
14353
    }
14354
 
14355
    public void validate() throws org.apache.thrift.TException {
14356
      // check for required fields
14357
    }
14358
 
14359
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
14360
      try {
14361
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
14362
      } catch (org.apache.thrift.TException te) {
14363
        throw new java.io.IOException(te);
14364
      }
14365
    }
14366
 
14367
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
14368
      try {
14369
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
14370
      } catch (org.apache.thrift.TException te) {
14371
        throw new java.io.IOException(te);
14372
      }
14373
    }
14374
 
14375
  }
14376
 
1982 varun.gupt 14377
}