Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
1982 varun.gupt 1
/**
3430 rajveer 2
 * Autogenerated by Thrift Compiler (0.7.0)
1982 varun.gupt 3
 *
4
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
 */
6
package in.shop2020.model.v1.user;
7
 
8
import java.util.List;
9
import java.util.ArrayList;
10
import java.util.Map;
11
import java.util.HashMap;
12
import java.util.EnumMap;
13
import java.util.Set;
14
import java.util.HashSet;
15
import java.util.EnumSet;
16
import java.util.Collections;
17
import java.util.BitSet;
3430 rajveer 18
import java.nio.ByteBuffer;
1982 varun.gupt 19
import java.util.Arrays;
20
import org.slf4j.Logger;
21
import org.slf4j.LoggerFactory;
22
 
23
public class PromotionService {
24
 
25
  /**
26
   * Promotion Service
27
   */
3374 rajveer 28
  public interface Iface extends in.shop2020.generic.GenericService.Iface {
1982 varun.gupt 29
 
3430 rajveer 30
    public void createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 31
 
3430 rajveer 32
    public List<Promotion> getAllPromotions() throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 33
 
3430 rajveer 34
    public Promotion getPromotionById(long promotionId) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 35
 
3430 rajveer 36
    public void generateCouponsForPromotion(long promotionId, String couponCode) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 37
 
3430 rajveer 38
    public Cart applyCoupon(String couponCode, long cartId) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 39
 
3430 rajveer 40
    public void trackCouponUsage(String couponCode, long transactionId, long userId) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 41
 
3430 rajveer 42
    public long getCouponUsageCountByUser(String couponCode, long userId) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 43
 
3385 varun.gupt 44
    /**
45
     * Returns a list of active coupons
46
     */
3430 rajveer 47
    public List<Coupon> getActiveCoupons() throws PromotionException, org.apache.thrift.TException;
3385 varun.gupt 48
 
49
    /**
50
     * Returns the count of successful payments done using a given coupon
51
     * 
52
     * @param couponCode
53
     */
3430 rajveer 54
    public long getSuccessfulPaymentCountForCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException;
3385 varun.gupt 55
 
56
    /**
57
     * Returns the doc string of the rule module
58
     * 
59
     * @param ruleName
60
     */
3430 rajveer 61
    public String getRuleDocString(String ruleName) throws org.apache.thrift.TException;
3385 varun.gupt 62
 
4189 varun.gupt 63
    public List<ItemCouponDiscount> getItemDiscountMap(List<Long> itemIds) throws PromotionException, org.apache.thrift.TException;
64
 
4494 varun.gupt 65
    public Map<String,Double> getDiscountsForEntity(long entityId) throws org.apache.thrift.TException;
66
 
1982 varun.gupt 67
  }
68
 
3430 rajveer 69
  public interface AsyncIface extends in.shop2020.generic.GenericService .AsyncIface {
1982 varun.gupt 70
 
3430 rajveer 71
    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 72
 
3430 rajveer 73
    public void getAllPromotions(org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getAllPromotions_call> resultHandler) throws org.apache.thrift.TException;
74
 
75
    public void getPromotionById(long promotionId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getPromotionById_call> resultHandler) throws org.apache.thrift.TException;
76
 
77
    public void generateCouponsForPromotion(long promotionId, String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.generateCouponsForPromotion_call> resultHandler) throws org.apache.thrift.TException;
78
 
79
    public void applyCoupon(String couponCode, long cartId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.applyCoupon_call> resultHandler) throws org.apache.thrift.TException;
80
 
81
    public void trackCouponUsage(String couponCode, long transactionId, long userId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.trackCouponUsage_call> resultHandler) throws org.apache.thrift.TException;
82
 
83
    public void getCouponUsageCountByUser(String couponCode, long userId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getCouponUsageCountByUser_call> resultHandler) throws org.apache.thrift.TException;
84
 
85
    public void getActiveCoupons(org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getActiveCoupons_call> resultHandler) throws org.apache.thrift.TException;
86
 
87
    public void getSuccessfulPaymentCountForCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getSuccessfulPaymentCountForCoupon_call> resultHandler) throws org.apache.thrift.TException;
88
 
89
    public void getRuleDocString(String ruleName, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getRuleDocString_call> resultHandler) throws org.apache.thrift.TException;
90
 
4189 varun.gupt 91
    public void getItemDiscountMap(List<Long> itemIds, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getItemDiscountMap_call> resultHandler) throws org.apache.thrift.TException;
92
 
4494 varun.gupt 93
    public void getDiscountsForEntity(long entityId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getDiscountsForEntity_call> resultHandler) throws org.apache.thrift.TException;
94
 
3430 rajveer 95
  }
96
 
97
  public static class Client extends in.shop2020.generic.GenericService.Client implements Iface {
98
    public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> {
99
      public Factory() {}
100
      public Client getClient(org.apache.thrift.protocol.TProtocol prot) {
101
        return new Client(prot);
102
      }
103
      public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
104
        return new Client(iprot, oprot);
105
      }
1982 varun.gupt 106
    }
107
 
3430 rajveer 108
    public Client(org.apache.thrift.protocol.TProtocol prot)
1982 varun.gupt 109
    {
3430 rajveer 110
      super(prot, prot);
1982 varun.gupt 111
    }
112
 
3430 rajveer 113
    public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
114
      super(iprot, oprot);
1982 varun.gupt 115
    }
116
 
3430 rajveer 117
    public void createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 118
    {
119
      send_createPromotion(name, ruleExecutionSrc, startOn, endOn);
120
      recv_createPromotion();
121
    }
122
 
3430 rajveer 123
    public void send_createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn) throws org.apache.thrift.TException
1982 varun.gupt 124
    {
125
      createPromotion_args args = new createPromotion_args();
3430 rajveer 126
      args.setName(name);
127
      args.setRuleExecutionSrc(ruleExecutionSrc);
128
      args.setStartOn(startOn);
129
      args.setEndOn(endOn);
130
      sendBase("createPromotion", args);
1982 varun.gupt 131
    }
132
 
3430 rajveer 133
    public void recv_createPromotion() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 134
    {
135
      createPromotion_result result = new createPromotion_result();
3430 rajveer 136
      receiveBase(result, "createPromotion");
1982 varun.gupt 137
      if (result.pex != null) {
138
        throw result.pex;
139
      }
140
      return;
141
    }
142
 
3430 rajveer 143
    public List<Promotion> getAllPromotions() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 144
    {
145
      send_getAllPromotions();
146
      return recv_getAllPromotions();
147
    }
148
 
3430 rajveer 149
    public void send_getAllPromotions() throws org.apache.thrift.TException
1982 varun.gupt 150
    {
151
      getAllPromotions_args args = new getAllPromotions_args();
3430 rajveer 152
      sendBase("getAllPromotions", args);
1982 varun.gupt 153
    }
154
 
3430 rajveer 155
    public List<Promotion> recv_getAllPromotions() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 156
    {
157
      getAllPromotions_result result = new getAllPromotions_result();
3430 rajveer 158
      receiveBase(result, "getAllPromotions");
1982 varun.gupt 159
      if (result.isSetSuccess()) {
160
        return result.success;
161
      }
162
      if (result.pex != null) {
163
        throw result.pex;
164
      }
3430 rajveer 165
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllPromotions failed: unknown result");
1982 varun.gupt 166
    }
167
 
3430 rajveer 168
    public Promotion getPromotionById(long promotionId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 169
    {
170
      send_getPromotionById(promotionId);
171
      return recv_getPromotionById();
172
    }
173
 
3430 rajveer 174
    public void send_getPromotionById(long promotionId) throws org.apache.thrift.TException
1982 varun.gupt 175
    {
176
      getPromotionById_args args = new getPromotionById_args();
3430 rajveer 177
      args.setPromotionId(promotionId);
178
      sendBase("getPromotionById", args);
1982 varun.gupt 179
    }
180
 
3430 rajveer 181
    public Promotion recv_getPromotionById() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 182
    {
183
      getPromotionById_result result = new getPromotionById_result();
3430 rajveer 184
      receiveBase(result, "getPromotionById");
1982 varun.gupt 185
      if (result.isSetSuccess()) {
186
        return result.success;
187
      }
188
      if (result.pex != null) {
189
        throw result.pex;
190
      }
3430 rajveer 191
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPromotionById failed: unknown result");
1982 varun.gupt 192
    }
193
 
3430 rajveer 194
    public void generateCouponsForPromotion(long promotionId, String couponCode) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 195
    {
196
      send_generateCouponsForPromotion(promotionId, couponCode);
197
      recv_generateCouponsForPromotion();
198
    }
199
 
3430 rajveer 200
    public void send_generateCouponsForPromotion(long promotionId, String couponCode) throws org.apache.thrift.TException
1982 varun.gupt 201
    {
202
      generateCouponsForPromotion_args args = new generateCouponsForPromotion_args();
3430 rajveer 203
      args.setPromotionId(promotionId);
204
      args.setCouponCode(couponCode);
205
      sendBase("generateCouponsForPromotion", args);
1982 varun.gupt 206
    }
207
 
3430 rajveer 208
    public void recv_generateCouponsForPromotion() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 209
    {
210
      generateCouponsForPromotion_result result = new generateCouponsForPromotion_result();
3430 rajveer 211
      receiveBase(result, "generateCouponsForPromotion");
1982 varun.gupt 212
      if (result.pex != null) {
213
        throw result.pex;
214
      }
215
      return;
216
    }
217
 
3430 rajveer 218
    public Cart applyCoupon(String couponCode, long cartId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 219
    {
220
      send_applyCoupon(couponCode, cartId);
221
      return recv_applyCoupon();
222
    }
223
 
3430 rajveer 224
    public void send_applyCoupon(String couponCode, long cartId) throws org.apache.thrift.TException
1982 varun.gupt 225
    {
226
      applyCoupon_args args = new applyCoupon_args();
3430 rajveer 227
      args.setCouponCode(couponCode);
228
      args.setCartId(cartId);
229
      sendBase("applyCoupon", args);
1982 varun.gupt 230
    }
231
 
3430 rajveer 232
    public Cart recv_applyCoupon() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 233
    {
234
      applyCoupon_result result = new applyCoupon_result();
3430 rajveer 235
      receiveBase(result, "applyCoupon");
1982 varun.gupt 236
      if (result.isSetSuccess()) {
237
        return result.success;
238
      }
239
      if (result.pex != null) {
240
        throw result.pex;
241
      }
3430 rajveer 242
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "applyCoupon failed: unknown result");
1982 varun.gupt 243
    }
244
 
3430 rajveer 245
    public void trackCouponUsage(String couponCode, long transactionId, long userId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 246
    {
247
      send_trackCouponUsage(couponCode, transactionId, userId);
248
      recv_trackCouponUsage();
249
    }
250
 
3430 rajveer 251
    public void send_trackCouponUsage(String couponCode, long transactionId, long userId) throws org.apache.thrift.TException
1982 varun.gupt 252
    {
253
      trackCouponUsage_args args = new trackCouponUsage_args();
3430 rajveer 254
      args.setCouponCode(couponCode);
255
      args.setTransactionId(transactionId);
256
      args.setUserId(userId);
257
      sendBase("trackCouponUsage", args);
1982 varun.gupt 258
    }
259
 
3430 rajveer 260
    public void recv_trackCouponUsage() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 261
    {
262
      trackCouponUsage_result result = new trackCouponUsage_result();
3430 rajveer 263
      receiveBase(result, "trackCouponUsage");
1982 varun.gupt 264
      if (result.pex != null) {
265
        throw result.pex;
266
      }
267
      return;
268
    }
269
 
3430 rajveer 270
    public long getCouponUsageCountByUser(String couponCode, long userId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 271
    {
272
      send_getCouponUsageCountByUser(couponCode, userId);
273
      return recv_getCouponUsageCountByUser();
274
    }
275
 
3430 rajveer 276
    public void send_getCouponUsageCountByUser(String couponCode, long userId) throws org.apache.thrift.TException
1982 varun.gupt 277
    {
278
      getCouponUsageCountByUser_args args = new getCouponUsageCountByUser_args();
3430 rajveer 279
      args.setCouponCode(couponCode);
280
      args.setUserId(userId);
281
      sendBase("getCouponUsageCountByUser", args);
1982 varun.gupt 282
    }
283
 
3430 rajveer 284
    public long recv_getCouponUsageCountByUser() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 285
    {
286
      getCouponUsageCountByUser_result result = new getCouponUsageCountByUser_result();
3430 rajveer 287
      receiveBase(result, "getCouponUsageCountByUser");
1982 varun.gupt 288
      if (result.isSetSuccess()) {
289
        return result.success;
290
      }
291
      if (result.pex != null) {
292
        throw result.pex;
293
      }
3430 rajveer 294
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCouponUsageCountByUser failed: unknown result");
1982 varun.gupt 295
    }
296
 
3430 rajveer 297
    public List<Coupon> getActiveCoupons() throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 298
    {
299
      send_getActiveCoupons();
300
      return recv_getActiveCoupons();
301
    }
302
 
3430 rajveer 303
    public void send_getActiveCoupons() throws org.apache.thrift.TException
3385 varun.gupt 304
    {
305
      getActiveCoupons_args args = new getActiveCoupons_args();
3430 rajveer 306
      sendBase("getActiveCoupons", args);
3385 varun.gupt 307
    }
308
 
3430 rajveer 309
    public List<Coupon> recv_getActiveCoupons() throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 310
    {
311
      getActiveCoupons_result result = new getActiveCoupons_result();
3430 rajveer 312
      receiveBase(result, "getActiveCoupons");
3385 varun.gupt 313
      if (result.isSetSuccess()) {
314
        return result.success;
315
      }
316
      if (result.pex != null) {
317
        throw result.pex;
318
      }
3430 rajveer 319
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getActiveCoupons failed: unknown result");
3385 varun.gupt 320
    }
321
 
3430 rajveer 322
    public long getSuccessfulPaymentCountForCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 323
    {
324
      send_getSuccessfulPaymentCountForCoupon(couponCode);
325
      return recv_getSuccessfulPaymentCountForCoupon();
326
    }
327
 
3430 rajveer 328
    public void send_getSuccessfulPaymentCountForCoupon(String couponCode) throws org.apache.thrift.TException
3385 varun.gupt 329
    {
330
      getSuccessfulPaymentCountForCoupon_args args = new getSuccessfulPaymentCountForCoupon_args();
3430 rajveer 331
      args.setCouponCode(couponCode);
332
      sendBase("getSuccessfulPaymentCountForCoupon", args);
3385 varun.gupt 333
    }
334
 
3430 rajveer 335
    public long recv_getSuccessfulPaymentCountForCoupon() throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 336
    {
337
      getSuccessfulPaymentCountForCoupon_result result = new getSuccessfulPaymentCountForCoupon_result();
3430 rajveer 338
      receiveBase(result, "getSuccessfulPaymentCountForCoupon");
3385 varun.gupt 339
      if (result.isSetSuccess()) {
340
        return result.success;
341
      }
342
      if (result.pex != null) {
343
        throw result.pex;
344
      }
3430 rajveer 345
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getSuccessfulPaymentCountForCoupon failed: unknown result");
3385 varun.gupt 346
    }
347
 
3430 rajveer 348
    public String getRuleDocString(String ruleName) throws org.apache.thrift.TException
3385 varun.gupt 349
    {
350
      send_getRuleDocString(ruleName);
351
      return recv_getRuleDocString();
352
    }
353
 
3430 rajveer 354
    public void send_getRuleDocString(String ruleName) throws org.apache.thrift.TException
3385 varun.gupt 355
    {
356
      getRuleDocString_args args = new getRuleDocString_args();
3430 rajveer 357
      args.setRuleName(ruleName);
358
      sendBase("getRuleDocString", args);
3385 varun.gupt 359
    }
360
 
3430 rajveer 361
    public String recv_getRuleDocString() throws org.apache.thrift.TException
3385 varun.gupt 362
    {
363
      getRuleDocString_result result = new getRuleDocString_result();
3430 rajveer 364
      receiveBase(result, "getRuleDocString");
3385 varun.gupt 365
      if (result.isSetSuccess()) {
366
        return result.success;
367
      }
3430 rajveer 368
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getRuleDocString failed: unknown result");
3385 varun.gupt 369
    }
370
 
4189 varun.gupt 371
    public List<ItemCouponDiscount> getItemDiscountMap(List<Long> itemIds) throws PromotionException, org.apache.thrift.TException
372
    {
373
      send_getItemDiscountMap(itemIds);
374
      return recv_getItemDiscountMap();
375
    }
376
 
377
    public void send_getItemDiscountMap(List<Long> itemIds) throws org.apache.thrift.TException
378
    {
379
      getItemDiscountMap_args args = new getItemDiscountMap_args();
380
      args.setItemIds(itemIds);
381
      sendBase("getItemDiscountMap", args);
382
    }
383
 
384
    public List<ItemCouponDiscount> recv_getItemDiscountMap() throws PromotionException, org.apache.thrift.TException
385
    {
386
      getItemDiscountMap_result result = new getItemDiscountMap_result();
387
      receiveBase(result, "getItemDiscountMap");
388
      if (result.isSetSuccess()) {
389
        return result.success;
390
      }
391
      if (result.pex != null) {
392
        throw result.pex;
393
      }
394
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getItemDiscountMap failed: unknown result");
395
    }
396
 
4494 varun.gupt 397
    public Map<String,Double> getDiscountsForEntity(long entityId) throws org.apache.thrift.TException
398
    {
399
      send_getDiscountsForEntity(entityId);
400
      return recv_getDiscountsForEntity();
401
    }
402
 
403
    public void send_getDiscountsForEntity(long entityId) throws org.apache.thrift.TException
404
    {
405
      getDiscountsForEntity_args args = new getDiscountsForEntity_args();
406
      args.setEntityId(entityId);
407
      sendBase("getDiscountsForEntity", args);
408
    }
409
 
410
    public Map<String,Double> recv_getDiscountsForEntity() throws org.apache.thrift.TException
411
    {
412
      getDiscountsForEntity_result result = new getDiscountsForEntity_result();
413
      receiveBase(result, "getDiscountsForEntity");
414
      if (result.isSetSuccess()) {
415
        return result.success;
416
      }
417
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getDiscountsForEntity failed: unknown result");
418
    }
419
 
1982 varun.gupt 420
  }
3430 rajveer 421
  public static class AsyncClient extends in.shop2020.generic.GenericService.AsyncClient implements AsyncIface {
422
    public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
423
      private org.apache.thrift.async.TAsyncClientManager clientManager;
424
      private org.apache.thrift.protocol.TProtocolFactory protocolFactory;
425
      public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) {
426
        this.clientManager = clientManager;
427
        this.protocolFactory = protocolFactory;
428
      }
429
      public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) {
430
        return new AsyncClient(protocolFactory, clientManager, transport);
431
      }
1982 varun.gupt 432
    }
433
 
3430 rajveer 434
    public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) {
435
      super(protocolFactory, clientManager, transport);
436
    }
1982 varun.gupt 437
 
3430 rajveer 438
    public void createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn, org.apache.thrift.async.AsyncMethodCallback<createPromotion_call> resultHandler) throws org.apache.thrift.TException {
439
      checkReady();
440
      createPromotion_call method_call = new createPromotion_call(name, ruleExecutionSrc, startOn, endOn, resultHandler, this, ___protocolFactory, ___transport);
441
      this.___currentMethod = method_call;
442
      ___manager.call(method_call);
1982 varun.gupt 443
    }
444
 
3430 rajveer 445
    public static class createPromotion_call extends org.apache.thrift.async.TAsyncMethodCall {
446
      private String name;
447
      private String ruleExecutionSrc;
448
      private long startOn;
449
      private long endOn;
450
      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 {
451
        super(client, protocolFactory, transport, resultHandler, false);
452
        this.name = name;
453
        this.ruleExecutionSrc = ruleExecutionSrc;
454
        this.startOn = startOn;
455
        this.endOn = endOn;
1982 varun.gupt 456
      }
457
 
3430 rajveer 458
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
459
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createPromotion", org.apache.thrift.protocol.TMessageType.CALL, 0));
1982 varun.gupt 460
        createPromotion_args args = new createPromotion_args();
3430 rajveer 461
        args.setName(name);
462
        args.setRuleExecutionSrc(ruleExecutionSrc);
463
        args.setStartOn(startOn);
464
        args.setEndOn(endOn);
465
        args.write(prot);
466
        prot.writeMessageEnd();
1982 varun.gupt 467
      }
468
 
3430 rajveer 469
      public void getResult() throws PromotionException, org.apache.thrift.TException {
470
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
471
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 472
        }
3430 rajveer 473
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
474
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
475
        (new Client(prot)).recv_createPromotion();
1982 varun.gupt 476
      }
3430 rajveer 477
    }
1982 varun.gupt 478
 
3430 rajveer 479
    public void getAllPromotions(org.apache.thrift.async.AsyncMethodCallback<getAllPromotions_call> resultHandler) throws org.apache.thrift.TException {
480
      checkReady();
481
      getAllPromotions_call method_call = new getAllPromotions_call(resultHandler, this, ___protocolFactory, ___transport);
482
      this.___currentMethod = method_call;
483
      ___manager.call(method_call);
1982 varun.gupt 484
    }
485
 
3430 rajveer 486
    public static class getAllPromotions_call extends org.apache.thrift.async.TAsyncMethodCall {
487
      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 {
488
        super(client, protocolFactory, transport, resultHandler, false);
1982 varun.gupt 489
      }
490
 
3430 rajveer 491
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
492
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAllPromotions", org.apache.thrift.protocol.TMessageType.CALL, 0));
493
        getAllPromotions_args args = new getAllPromotions_args();
494
        args.write(prot);
495
        prot.writeMessageEnd();
496
      }
1982 varun.gupt 497
 
3430 rajveer 498
      public List<Promotion> getResult() throws PromotionException, org.apache.thrift.TException {
499
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
500
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 501
        }
3430 rajveer 502
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
503
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
504
        return (new Client(prot)).recv_getAllPromotions();
1982 varun.gupt 505
      }
3430 rajveer 506
    }
1982 varun.gupt 507
 
3430 rajveer 508
    public void getPromotionById(long promotionId, org.apache.thrift.async.AsyncMethodCallback<getPromotionById_call> resultHandler) throws org.apache.thrift.TException {
509
      checkReady();
510
      getPromotionById_call method_call = new getPromotionById_call(promotionId, resultHandler, this, ___protocolFactory, ___transport);
511
      this.___currentMethod = method_call;
512
      ___manager.call(method_call);
1982 varun.gupt 513
    }
514
 
3430 rajveer 515
    public static class getPromotionById_call extends org.apache.thrift.async.TAsyncMethodCall {
516
      private long promotionId;
517
      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 {
518
        super(client, protocolFactory, transport, resultHandler, false);
519
        this.promotionId = promotionId;
1982 varun.gupt 520
      }
521
 
3430 rajveer 522
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
523
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getPromotionById", org.apache.thrift.protocol.TMessageType.CALL, 0));
524
        getPromotionById_args args = new getPromotionById_args();
525
        args.setPromotionId(promotionId);
526
        args.write(prot);
527
        prot.writeMessageEnd();
528
      }
1982 varun.gupt 529
 
3430 rajveer 530
      public Promotion getResult() throws PromotionException, org.apache.thrift.TException {
531
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
532
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 533
        }
3430 rajveer 534
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
535
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
536
        return (new Client(prot)).recv_getPromotionById();
1982 varun.gupt 537
      }
3430 rajveer 538
    }
1982 varun.gupt 539
 
3430 rajveer 540
    public void generateCouponsForPromotion(long promotionId, String couponCode, org.apache.thrift.async.AsyncMethodCallback<generateCouponsForPromotion_call> resultHandler) throws org.apache.thrift.TException {
541
      checkReady();
542
      generateCouponsForPromotion_call method_call = new generateCouponsForPromotion_call(promotionId, couponCode, resultHandler, this, ___protocolFactory, ___transport);
543
      this.___currentMethod = method_call;
544
      ___manager.call(method_call);
1982 varun.gupt 545
    }
546
 
3430 rajveer 547
    public static class generateCouponsForPromotion_call extends org.apache.thrift.async.TAsyncMethodCall {
548
      private long promotionId;
549
      private String couponCode;
550
      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 {
551
        super(client, protocolFactory, transport, resultHandler, false);
552
        this.promotionId = promotionId;
553
        this.couponCode = couponCode;
1982 varun.gupt 554
      }
555
 
3430 rajveer 556
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
557
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("generateCouponsForPromotion", org.apache.thrift.protocol.TMessageType.CALL, 0));
558
        generateCouponsForPromotion_args args = new generateCouponsForPromotion_args();
559
        args.setPromotionId(promotionId);
560
        args.setCouponCode(couponCode);
561
        args.write(prot);
562
        prot.writeMessageEnd();
3385 varun.gupt 563
      }
564
 
3430 rajveer 565
      public void getResult() throws PromotionException, org.apache.thrift.TException {
566
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
567
          throw new IllegalStateException("Method call not finished!");
3385 varun.gupt 568
        }
3430 rajveer 569
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
570
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
571
        (new Client(prot)).recv_generateCouponsForPromotion();
3385 varun.gupt 572
      }
573
    }
574
 
3430 rajveer 575
    public void applyCoupon(String couponCode, long cartId, org.apache.thrift.async.AsyncMethodCallback<applyCoupon_call> resultHandler) throws org.apache.thrift.TException {
576
      checkReady();
577
      applyCoupon_call method_call = new applyCoupon_call(couponCode, cartId, resultHandler, this, ___protocolFactory, ___transport);
578
      this.___currentMethod = method_call;
579
      ___manager.call(method_call);
3385 varun.gupt 580
    }
581
 
3430 rajveer 582
    public static class applyCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
583
      private String couponCode;
584
      private long cartId;
585
      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 {
586
        super(client, protocolFactory, transport, resultHandler, false);
587
        this.couponCode = couponCode;
588
        this.cartId = cartId;
1982 varun.gupt 589
      }
590
 
3430 rajveer 591
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
592
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("applyCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
593
        applyCoupon_args args = new applyCoupon_args();
594
        args.setCouponCode(couponCode);
595
        args.setCartId(cartId);
596
        args.write(prot);
597
        prot.writeMessageEnd();
1982 varun.gupt 598
      }
599
 
3430 rajveer 600
      public Cart getResult() throws PromotionException, org.apache.thrift.TException {
601
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
602
          throw new IllegalStateException("Method call not finished!");
603
        }
604
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
605
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
606
        return (new Client(prot)).recv_applyCoupon();
1982 varun.gupt 607
      }
3430 rajveer 608
    }
1982 varun.gupt 609
 
3430 rajveer 610
    public void trackCouponUsage(String couponCode, long transactionId, long userId, org.apache.thrift.async.AsyncMethodCallback<trackCouponUsage_call> resultHandler) throws org.apache.thrift.TException {
611
      checkReady();
612
      trackCouponUsage_call method_call = new trackCouponUsage_call(couponCode, transactionId, userId, resultHandler, this, ___protocolFactory, ___transport);
613
      this.___currentMethod = method_call;
614
      ___manager.call(method_call);
615
    }
1982 varun.gupt 616
 
3430 rajveer 617
    public static class trackCouponUsage_call extends org.apache.thrift.async.TAsyncMethodCall {
618
      private String couponCode;
619
      private long transactionId;
620
      private long userId;
621
      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 {
622
        super(client, protocolFactory, transport, resultHandler, false);
623
        this.couponCode = couponCode;
624
        this.transactionId = transactionId;
625
        this.userId = userId;
1982 varun.gupt 626
      }
627
 
3430 rajveer 628
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
629
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("trackCouponUsage", org.apache.thrift.protocol.TMessageType.CALL, 0));
630
        trackCouponUsage_args args = new trackCouponUsage_args();
631
        args.setCouponCode(couponCode);
632
        args.setTransactionId(transactionId);
633
        args.setUserId(userId);
634
        args.write(prot);
635
        prot.writeMessageEnd();
1982 varun.gupt 636
      }
637
 
3430 rajveer 638
      public void getResult() throws PromotionException, org.apache.thrift.TException {
639
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
640
          throw new IllegalStateException("Method call not finished!");
641
        }
642
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
643
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
644
        (new Client(prot)).recv_trackCouponUsage();
1982 varun.gupt 645
      }
646
    }
647
 
3430 rajveer 648
    public void getCouponUsageCountByUser(String couponCode, long userId, org.apache.thrift.async.AsyncMethodCallback<getCouponUsageCountByUser_call> resultHandler) throws org.apache.thrift.TException {
649
      checkReady();
650
      getCouponUsageCountByUser_call method_call = new getCouponUsageCountByUser_call(couponCode, userId, resultHandler, this, ___protocolFactory, ___transport);
651
      this.___currentMethod = method_call;
652
      ___manager.call(method_call);
1982 varun.gupt 653
    }
654
 
3430 rajveer 655
    public static class getCouponUsageCountByUser_call extends org.apache.thrift.async.TAsyncMethodCall {
656
      private String couponCode;
657
      private long userId;
658
      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 {
659
        super(client, protocolFactory, transport, resultHandler, false);
660
        this.couponCode = couponCode;
661
        this.userId = userId;
662
      }
1982 varun.gupt 663
 
3430 rajveer 664
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
665
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getCouponUsageCountByUser", org.apache.thrift.protocol.TMessageType.CALL, 0));
666
        getCouponUsageCountByUser_args args = new getCouponUsageCountByUser_args();
667
        args.setCouponCode(couponCode);
668
        args.setUserId(userId);
669
        args.write(prot);
670
        prot.writeMessageEnd();
671
      }
1982 varun.gupt 672
 
3430 rajveer 673
      public long getResult() throws PromotionException, org.apache.thrift.TException {
674
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
675
          throw new IllegalStateException("Method call not finished!");
676
        }
677
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
678
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
679
        return (new Client(prot)).recv_getCouponUsageCountByUser();
680
      }
1982 varun.gupt 681
    }
682
 
3430 rajveer 683
    public void getActiveCoupons(org.apache.thrift.async.AsyncMethodCallback<getActiveCoupons_call> resultHandler) throws org.apache.thrift.TException {
684
      checkReady();
685
      getActiveCoupons_call method_call = new getActiveCoupons_call(resultHandler, this, ___protocolFactory, ___transport);
686
      this.___currentMethod = method_call;
687
      ___manager.call(method_call);
1982 varun.gupt 688
    }
689
 
3430 rajveer 690
    public static class getActiveCoupons_call extends org.apache.thrift.async.TAsyncMethodCall {
691
      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 {
692
        super(client, protocolFactory, transport, resultHandler, false);
1982 varun.gupt 693
      }
694
 
3430 rajveer 695
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
696
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getActiveCoupons", org.apache.thrift.protocol.TMessageType.CALL, 0));
697
        getActiveCoupons_args args = new getActiveCoupons_args();
698
        args.write(prot);
699
        prot.writeMessageEnd();
700
      }
1982 varun.gupt 701
 
3430 rajveer 702
      public List<Coupon> getResult() throws PromotionException, org.apache.thrift.TException {
703
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
704
          throw new IllegalStateException("Method call not finished!");
705
        }
706
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
707
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
708
        return (new Client(prot)).recv_getActiveCoupons();
1982 varun.gupt 709
      }
710
    }
711
 
3430 rajveer 712
    public void getSuccessfulPaymentCountForCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<getSuccessfulPaymentCountForCoupon_call> resultHandler) throws org.apache.thrift.TException {
713
      checkReady();
714
      getSuccessfulPaymentCountForCoupon_call method_call = new getSuccessfulPaymentCountForCoupon_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
715
      this.___currentMethod = method_call;
716
      ___manager.call(method_call);
1982 varun.gupt 717
    }
718
 
3430 rajveer 719
    public static class getSuccessfulPaymentCountForCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
720
      private String couponCode;
721
      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 {
722
        super(client, protocolFactory, transport, resultHandler, false);
723
        this.couponCode = couponCode;
1982 varun.gupt 724
      }
725
 
3430 rajveer 726
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
727
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getSuccessfulPaymentCountForCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
728
        getSuccessfulPaymentCountForCoupon_args args = new getSuccessfulPaymentCountForCoupon_args();
729
        args.setCouponCode(couponCode);
730
        args.write(prot);
731
        prot.writeMessageEnd();
732
      }
1982 varun.gupt 733
 
3430 rajveer 734
      public long getResult() throws PromotionException, org.apache.thrift.TException {
735
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
736
          throw new IllegalStateException("Method call not finished!");
737
        }
738
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
739
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
740
        return (new Client(prot)).recv_getSuccessfulPaymentCountForCoupon();
741
      }
1982 varun.gupt 742
    }
743
 
3430 rajveer 744
    public void getRuleDocString(String ruleName, org.apache.thrift.async.AsyncMethodCallback<getRuleDocString_call> resultHandler) throws org.apache.thrift.TException {
745
      checkReady();
746
      getRuleDocString_call method_call = new getRuleDocString_call(ruleName, resultHandler, this, ___protocolFactory, ___transport);
747
      this.___currentMethod = method_call;
748
      ___manager.call(method_call);
1982 varun.gupt 749
    }
750
 
3430 rajveer 751
    public static class getRuleDocString_call extends org.apache.thrift.async.TAsyncMethodCall {
752
      private String ruleName;
753
      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 {
754
        super(client, protocolFactory, transport, resultHandler, false);
755
        this.ruleName = ruleName;
756
      }
1982 varun.gupt 757
 
3430 rajveer 758
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
759
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getRuleDocString", org.apache.thrift.protocol.TMessageType.CALL, 0));
760
        getRuleDocString_args args = new getRuleDocString_args();
761
        args.setRuleName(ruleName);
762
        args.write(prot);
763
        prot.writeMessageEnd();
1982 varun.gupt 764
      }
765
 
3430 rajveer 766
      public String getResult() throws org.apache.thrift.TException {
767
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
768
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 769
        }
3430 rajveer 770
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
771
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
772
        return (new Client(prot)).recv_getRuleDocString();
1982 varun.gupt 773
      }
774
    }
775
 
4189 varun.gupt 776
    public void getItemDiscountMap(List<Long> itemIds, org.apache.thrift.async.AsyncMethodCallback<getItemDiscountMap_call> resultHandler) throws org.apache.thrift.TException {
777
      checkReady();
778
      getItemDiscountMap_call method_call = new getItemDiscountMap_call(itemIds, resultHandler, this, ___protocolFactory, ___transport);
779
      this.___currentMethod = method_call;
780
      ___manager.call(method_call);
781
    }
782
 
783
    public static class getItemDiscountMap_call extends org.apache.thrift.async.TAsyncMethodCall {
784
      private List<Long> itemIds;
785
      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 {
786
        super(client, protocolFactory, transport, resultHandler, false);
787
        this.itemIds = itemIds;
788
      }
789
 
790
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
791
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getItemDiscountMap", org.apache.thrift.protocol.TMessageType.CALL, 0));
792
        getItemDiscountMap_args args = new getItemDiscountMap_args();
793
        args.setItemIds(itemIds);
794
        args.write(prot);
795
        prot.writeMessageEnd();
796
      }
797
 
798
      public List<ItemCouponDiscount> getResult() throws PromotionException, org.apache.thrift.TException {
799
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
800
          throw new IllegalStateException("Method call not finished!");
801
        }
802
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
803
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
804
        return (new Client(prot)).recv_getItemDiscountMap();
805
      }
806
    }
807
 
4494 varun.gupt 808
    public void getDiscountsForEntity(long entityId, org.apache.thrift.async.AsyncMethodCallback<getDiscountsForEntity_call> resultHandler) throws org.apache.thrift.TException {
809
      checkReady();
810
      getDiscountsForEntity_call method_call = new getDiscountsForEntity_call(entityId, resultHandler, this, ___protocolFactory, ___transport);
811
      this.___currentMethod = method_call;
812
      ___manager.call(method_call);
813
    }
814
 
815
    public static class getDiscountsForEntity_call extends org.apache.thrift.async.TAsyncMethodCall {
816
      private long entityId;
817
      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 {
818
        super(client, protocolFactory, transport, resultHandler, false);
819
        this.entityId = entityId;
820
      }
821
 
822
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
823
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getDiscountsForEntity", org.apache.thrift.protocol.TMessageType.CALL, 0));
824
        getDiscountsForEntity_args args = new getDiscountsForEntity_args();
825
        args.setEntityId(entityId);
826
        args.write(prot);
827
        prot.writeMessageEnd();
828
      }
829
 
830
      public Map<String,Double> getResult() throws org.apache.thrift.TException {
831
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
832
          throw new IllegalStateException("Method call not finished!");
833
        }
834
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
835
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
836
        return (new Client(prot)).recv_getDiscountsForEntity();
837
      }
838
    }
839
 
3430 rajveer 840
  }
1982 varun.gupt 841
 
3430 rajveer 842
  public static class Processor<I extends Iface> extends in.shop2020.generic.GenericService.Processor implements org.apache.thrift.TProcessor {
843
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
844
    public Processor(I iface) {
845
      super(iface, getProcessMap(new HashMap<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>>()));
1982 varun.gupt 846
    }
847
 
3430 rajveer 848
    protected Processor(I iface, Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> processMap) {
849
      super(iface, getProcessMap(processMap));
1982 varun.gupt 850
    }
851
 
3430 rajveer 852
    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) {
853
      processMap.put("createPromotion", new createPromotion());
854
      processMap.put("getAllPromotions", new getAllPromotions());
855
      processMap.put("getPromotionById", new getPromotionById());
856
      processMap.put("generateCouponsForPromotion", new generateCouponsForPromotion());
857
      processMap.put("applyCoupon", new applyCoupon());
858
      processMap.put("trackCouponUsage", new trackCouponUsage());
859
      processMap.put("getCouponUsageCountByUser", new getCouponUsageCountByUser());
860
      processMap.put("getActiveCoupons", new getActiveCoupons());
861
      processMap.put("getSuccessfulPaymentCountForCoupon", new getSuccessfulPaymentCountForCoupon());
862
      processMap.put("getRuleDocString", new getRuleDocString());
4189 varun.gupt 863
      processMap.put("getItemDiscountMap", new getItemDiscountMap());
4494 varun.gupt 864
      processMap.put("getDiscountsForEntity", new getDiscountsForEntity());
3430 rajveer 865
      return processMap;
1982 varun.gupt 866
    }
867
 
3430 rajveer 868
    private static class createPromotion<I extends Iface> extends org.apache.thrift.ProcessFunction<I, createPromotion_args> {
869
      public createPromotion() {
870
        super("createPromotion");
871
      }
1982 varun.gupt 872
 
3430 rajveer 873
      protected createPromotion_args getEmptyArgsInstance() {
874
        return new createPromotion_args();
875
      }
1982 varun.gupt 876
 
3430 rajveer 877
      protected createPromotion_result getResult(I iface, createPromotion_args args) throws org.apache.thrift.TException {
878
        createPromotion_result result = new createPromotion_result();
879
        try {
880
          iface.createPromotion(args.name, args.ruleExecutionSrc, args.startOn, args.endOn);
881
        } catch (PromotionException pex) {
882
          result.pex = pex;
1982 varun.gupt 883
        }
3430 rajveer 884
        return result;
1982 varun.gupt 885
      }
3430 rajveer 886
    }
1982 varun.gupt 887
 
3430 rajveer 888
    private static class getAllPromotions<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getAllPromotions_args> {
889
      public getAllPromotions() {
890
        super("getAllPromotions");
1982 varun.gupt 891
      }
892
 
3430 rajveer 893
      protected getAllPromotions_args getEmptyArgsInstance() {
894
        return new getAllPromotions_args();
1982 varun.gupt 895
      }
896
 
3430 rajveer 897
      protected getAllPromotions_result getResult(I iface, getAllPromotions_args args) throws org.apache.thrift.TException {
898
        getAllPromotions_result result = new getAllPromotions_result();
899
        try {
900
          result.success = iface.getAllPromotions();
901
        } catch (PromotionException pex) {
902
          result.pex = pex;
903
        }
904
        return result;
1982 varun.gupt 905
      }
3430 rajveer 906
    }
1982 varun.gupt 907
 
3430 rajveer 908
    private static class getPromotionById<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getPromotionById_args> {
909
      public getPromotionById() {
910
        super("getPromotionById");
1982 varun.gupt 911
      }
912
 
3430 rajveer 913
      protected getPromotionById_args getEmptyArgsInstance() {
914
        return new getPromotionById_args();
1982 varun.gupt 915
      }
916
 
3430 rajveer 917
      protected getPromotionById_result getResult(I iface, getPromotionById_args args) throws org.apache.thrift.TException {
918
        getPromotionById_result result = new getPromotionById_result();
919
        try {
920
          result.success = iface.getPromotionById(args.promotionId);
921
        } catch (PromotionException pex) {
922
          result.pex = pex;
923
        }
924
        return result;
1982 varun.gupt 925
      }
926
    }
927
 
3430 rajveer 928
    private static class generateCouponsForPromotion<I extends Iface> extends org.apache.thrift.ProcessFunction<I, generateCouponsForPromotion_args> {
929
      public generateCouponsForPromotion() {
930
        super("generateCouponsForPromotion");
931
      }
1982 varun.gupt 932
 
3430 rajveer 933
      protected generateCouponsForPromotion_args getEmptyArgsInstance() {
934
        return new generateCouponsForPromotion_args();
935
      }
1982 varun.gupt 936
 
3430 rajveer 937
      protected generateCouponsForPromotion_result getResult(I iface, generateCouponsForPromotion_args args) throws org.apache.thrift.TException {
938
        generateCouponsForPromotion_result result = new generateCouponsForPromotion_result();
939
        try {
940
          iface.generateCouponsForPromotion(args.promotionId, args.couponCode);
941
        } catch (PromotionException pex) {
942
          result.pex = pex;
943
        }
944
        return result;
945
      }
1982 varun.gupt 946
    }
947
 
3430 rajveer 948
    private static class applyCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, applyCoupon_args> {
949
      public applyCoupon() {
950
        super("applyCoupon");
951
      }
1982 varun.gupt 952
 
3430 rajveer 953
      protected applyCoupon_args getEmptyArgsInstance() {
954
        return new applyCoupon_args();
955
      }
1982 varun.gupt 956
 
3430 rajveer 957
      protected applyCoupon_result getResult(I iface, applyCoupon_args args) throws org.apache.thrift.TException {
958
        applyCoupon_result result = new applyCoupon_result();
959
        try {
960
          result.success = iface.applyCoupon(args.couponCode, args.cartId);
961
        } catch (PromotionException pex) {
962
          result.pex = pex;
963
        }
964
        return result;
1982 varun.gupt 965
      }
966
    }
967
 
3430 rajveer 968
    private static class trackCouponUsage<I extends Iface> extends org.apache.thrift.ProcessFunction<I, trackCouponUsage_args> {
969
      public trackCouponUsage() {
970
        super("trackCouponUsage");
971
      }
1982 varun.gupt 972
 
3430 rajveer 973
      protected trackCouponUsage_args getEmptyArgsInstance() {
974
        return new trackCouponUsage_args();
1982 varun.gupt 975
      }
976
 
3430 rajveer 977
      protected trackCouponUsage_result getResult(I iface, trackCouponUsage_args args) throws org.apache.thrift.TException {
978
        trackCouponUsage_result result = new trackCouponUsage_result();
979
        try {
980
          iface.trackCouponUsage(args.couponCode, args.transactionId, args.userId);
981
        } catch (PromotionException pex) {
982
          result.pex = pex;
983
        }
984
        return result;
985
      }
1982 varun.gupt 986
    }
987
 
3430 rajveer 988
    private static class getCouponUsageCountByUser<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getCouponUsageCountByUser_args> {
989
      public getCouponUsageCountByUser() {
990
        super("getCouponUsageCountByUser");
1982 varun.gupt 991
      }
992
 
3430 rajveer 993
      protected getCouponUsageCountByUser_args getEmptyArgsInstance() {
994
        return new getCouponUsageCountByUser_args();
995
      }
1982 varun.gupt 996
 
3430 rajveer 997
      protected getCouponUsageCountByUser_result getResult(I iface, getCouponUsageCountByUser_args args) throws org.apache.thrift.TException {
998
        getCouponUsageCountByUser_result result = new getCouponUsageCountByUser_result();
999
        try {
1000
          result.success = iface.getCouponUsageCountByUser(args.couponCode, args.userId);
1001
          result.setSuccessIsSet(true);
1002
        } catch (PromotionException pex) {
1003
          result.pex = pex;
1004
        }
1005
        return result;
1006
      }
1982 varun.gupt 1007
    }
1008
 
3430 rajveer 1009
    private static class getActiveCoupons<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getActiveCoupons_args> {
1010
      public getActiveCoupons() {
1011
        super("getActiveCoupons");
1012
      }
1982 varun.gupt 1013
 
3430 rajveer 1014
      protected getActiveCoupons_args getEmptyArgsInstance() {
1015
        return new getActiveCoupons_args();
1016
      }
1982 varun.gupt 1017
 
3430 rajveer 1018
      protected getActiveCoupons_result getResult(I iface, getActiveCoupons_args args) throws org.apache.thrift.TException {
1019
        getActiveCoupons_result result = new getActiveCoupons_result();
1020
        try {
1021
          result.success = iface.getActiveCoupons();
1022
        } catch (PromotionException pex) {
1023
          result.pex = pex;
1024
        }
1025
        return result;
1026
      }
1982 varun.gupt 1027
    }
1028
 
3430 rajveer 1029
    private static class getSuccessfulPaymentCountForCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getSuccessfulPaymentCountForCoupon_args> {
1030
      public getSuccessfulPaymentCountForCoupon() {
1031
        super("getSuccessfulPaymentCountForCoupon");
1982 varun.gupt 1032
      }
1033
 
3430 rajveer 1034
      protected getSuccessfulPaymentCountForCoupon_args getEmptyArgsInstance() {
1035
        return new getSuccessfulPaymentCountForCoupon_args();
1036
      }
1982 varun.gupt 1037
 
3430 rajveer 1038
      protected getSuccessfulPaymentCountForCoupon_result getResult(I iface, getSuccessfulPaymentCountForCoupon_args args) throws org.apache.thrift.TException {
1039
        getSuccessfulPaymentCountForCoupon_result result = new getSuccessfulPaymentCountForCoupon_result();
1040
        try {
1041
          result.success = iface.getSuccessfulPaymentCountForCoupon(args.couponCode);
1042
          result.setSuccessIsSet(true);
1043
        } catch (PromotionException pex) {
1044
          result.pex = pex;
1982 varun.gupt 1045
        }
3430 rajveer 1046
        return result;
1982 varun.gupt 1047
      }
1048
    }
1049
 
3430 rajveer 1050
    private static class getRuleDocString<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getRuleDocString_args> {
1051
      public getRuleDocString() {
1052
        super("getRuleDocString");
1053
      }
1982 varun.gupt 1054
 
3430 rajveer 1055
      protected getRuleDocString_args getEmptyArgsInstance() {
1056
        return new getRuleDocString_args();
1057
      }
1982 varun.gupt 1058
 
3430 rajveer 1059
      protected getRuleDocString_result getResult(I iface, getRuleDocString_args args) throws org.apache.thrift.TException {
1060
        getRuleDocString_result result = new getRuleDocString_result();
1061
        result.success = iface.getRuleDocString(args.ruleName);
1062
        return result;
1063
      }
1982 varun.gupt 1064
    }
1065
 
4189 varun.gupt 1066
    private static class getItemDiscountMap<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getItemDiscountMap_args> {
1067
      public getItemDiscountMap() {
1068
        super("getItemDiscountMap");
1069
      }
1070
 
1071
      protected getItemDiscountMap_args getEmptyArgsInstance() {
1072
        return new getItemDiscountMap_args();
1073
      }
1074
 
1075
      protected getItemDiscountMap_result getResult(I iface, getItemDiscountMap_args args) throws org.apache.thrift.TException {
1076
        getItemDiscountMap_result result = new getItemDiscountMap_result();
1077
        try {
1078
          result.success = iface.getItemDiscountMap(args.itemIds);
1079
        } catch (PromotionException pex) {
1080
          result.pex = pex;
1081
        }
1082
        return result;
1083
      }
1084
    }
1085
 
4494 varun.gupt 1086
    private static class getDiscountsForEntity<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getDiscountsForEntity_args> {
1087
      public getDiscountsForEntity() {
1088
        super("getDiscountsForEntity");
1089
      }
1090
 
1091
      protected getDiscountsForEntity_args getEmptyArgsInstance() {
1092
        return new getDiscountsForEntity_args();
1093
      }
1094
 
1095
      protected getDiscountsForEntity_result getResult(I iface, getDiscountsForEntity_args args) throws org.apache.thrift.TException {
1096
        getDiscountsForEntity_result result = new getDiscountsForEntity_result();
1097
        result.success = iface.getDiscountsForEntity(args.entityId);
1098
        return result;
1099
      }
1100
    }
1101
 
1982 varun.gupt 1102
  }
1103
 
3430 rajveer 1104
  public static class createPromotion_args implements org.apache.thrift.TBase<createPromotion_args, createPromotion_args._Fields>, java.io.Serializable, Cloneable   {
1105
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createPromotion_args");
1982 varun.gupt 1106
 
3430 rajveer 1107
    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);
1108
    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);
1109
    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);
1110
    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 1111
 
3430 rajveer 1112
    private String name; // required
1113
    private String ruleExecutionSrc; // required
1114
    private long startOn; // required
1115
    private long endOn; // required
1982 varun.gupt 1116
 
1117
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 1118
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 1119
      NAME((short)1, "name"),
1120
      RULE_EXECUTION_SRC((short)2, "ruleExecutionSrc"),
1121
      START_ON((short)3, "startOn"),
1122
      END_ON((short)4, "endOn");
1123
 
1124
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
1125
 
1126
      static {
1127
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
1128
          byName.put(field.getFieldName(), field);
1129
        }
1130
      }
1131
 
1132
      /**
1133
       * Find the _Fields constant that matches fieldId, or null if its not found.
1134
       */
1135
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 1136
        switch(fieldId) {
1137
          case 1: // NAME
1138
            return NAME;
1139
          case 2: // RULE_EXECUTION_SRC
1140
            return RULE_EXECUTION_SRC;
1141
          case 3: // START_ON
1142
            return START_ON;
1143
          case 4: // END_ON
1144
            return END_ON;
1145
          default:
1146
            return null;
1147
        }
1982 varun.gupt 1148
      }
1149
 
1150
      /**
1151
       * Find the _Fields constant that matches fieldId, throwing an exception
1152
       * if it is not found.
1153
       */
1154
      public static _Fields findByThriftIdOrThrow(int fieldId) {
1155
        _Fields fields = findByThriftId(fieldId);
1156
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
1157
        return fields;
1158
      }
1159
 
1160
      /**
1161
       * Find the _Fields constant that matches name, or null if its not found.
1162
       */
1163
      public static _Fields findByName(String name) {
1164
        return byName.get(name);
1165
      }
1166
 
1167
      private final short _thriftId;
1168
      private final String _fieldName;
1169
 
1170
      _Fields(short thriftId, String fieldName) {
1171
        _thriftId = thriftId;
1172
        _fieldName = fieldName;
1173
      }
1174
 
1175
      public short getThriftFieldId() {
1176
        return _thriftId;
1177
      }
1178
 
1179
      public String getFieldName() {
1180
        return _fieldName;
1181
      }
1182
    }
1183
 
1184
    // isset id assignments
1185
    private static final int __STARTON_ISSET_ID = 0;
1186
    private static final int __ENDON_ISSET_ID = 1;
1187
    private BitSet __isset_bit_vector = new BitSet(2);
1188
 
3430 rajveer 1189
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 1190
    static {
3430 rajveer 1191
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
1192
      tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, 
1193
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
1194
      tmpMap.put(_Fields.RULE_EXECUTION_SRC, new org.apache.thrift.meta_data.FieldMetaData("ruleExecutionSrc", org.apache.thrift.TFieldRequirementType.DEFAULT, 
1195
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
1196
      tmpMap.put(_Fields.START_ON, new org.apache.thrift.meta_data.FieldMetaData("startOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
1197
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
1198
      tmpMap.put(_Fields.END_ON, new org.apache.thrift.meta_data.FieldMetaData("endOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
1199
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
1200
      metaDataMap = Collections.unmodifiableMap(tmpMap);
1201
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createPromotion_args.class, metaDataMap);
1982 varun.gupt 1202
    }
1203
 
1204
    public createPromotion_args() {
1205
    }
1206
 
1207
    public createPromotion_args(
1208
      String name,
1209
      String ruleExecutionSrc,
1210
      long startOn,
1211
      long endOn)
1212
    {
1213
      this();
1214
      this.name = name;
1215
      this.ruleExecutionSrc = ruleExecutionSrc;
1216
      this.startOn = startOn;
1217
      setStartOnIsSet(true);
1218
      this.endOn = endOn;
1219
      setEndOnIsSet(true);
1220
    }
1221
 
1222
    /**
1223
     * Performs a deep copy on <i>other</i>.
1224
     */
1225
    public createPromotion_args(createPromotion_args other) {
1226
      __isset_bit_vector.clear();
1227
      __isset_bit_vector.or(other.__isset_bit_vector);
1228
      if (other.isSetName()) {
1229
        this.name = other.name;
1230
      }
1231
      if (other.isSetRuleExecutionSrc()) {
1232
        this.ruleExecutionSrc = other.ruleExecutionSrc;
1233
      }
1234
      this.startOn = other.startOn;
1235
      this.endOn = other.endOn;
1236
    }
1237
 
1238
    public createPromotion_args deepCopy() {
1239
      return new createPromotion_args(this);
1240
    }
1241
 
3430 rajveer 1242
    @Override
1243
    public void clear() {
1244
      this.name = null;
1245
      this.ruleExecutionSrc = null;
1246
      setStartOnIsSet(false);
1247
      this.startOn = 0;
1248
      setEndOnIsSet(false);
1249
      this.endOn = 0;
1982 varun.gupt 1250
    }
1251
 
1252
    public String getName() {
1253
      return this.name;
1254
    }
1255
 
3430 rajveer 1256
    public void setName(String name) {
1982 varun.gupt 1257
      this.name = name;
1258
    }
1259
 
1260
    public void unsetName() {
1261
      this.name = null;
1262
    }
1263
 
3430 rajveer 1264
    /** Returns true if field name is set (has been assigned a value) and false otherwise */
1982 varun.gupt 1265
    public boolean isSetName() {
1266
      return this.name != null;
1267
    }
1268
 
1269
    public void setNameIsSet(boolean value) {
1270
      if (!value) {
1271
        this.name = null;
1272
      }
1273
    }
1274
 
1275
    public String getRuleExecutionSrc() {
1276
      return this.ruleExecutionSrc;
1277
    }
1278
 
3430 rajveer 1279
    public void setRuleExecutionSrc(String ruleExecutionSrc) {
1982 varun.gupt 1280
      this.ruleExecutionSrc = ruleExecutionSrc;
1281
    }
1282
 
1283
    public void unsetRuleExecutionSrc() {
1284
      this.ruleExecutionSrc = null;
1285
    }
1286
 
3430 rajveer 1287
    /** Returns true if field ruleExecutionSrc is set (has been assigned a value) and false otherwise */
1982 varun.gupt 1288
    public boolean isSetRuleExecutionSrc() {
1289
      return this.ruleExecutionSrc != null;
1290
    }
1291
 
1292
    public void setRuleExecutionSrcIsSet(boolean value) {
1293
      if (!value) {
1294
        this.ruleExecutionSrc = null;
1295
      }
1296
    }
1297
 
1298
    public long getStartOn() {
1299
      return this.startOn;
1300
    }
1301
 
3430 rajveer 1302
    public void setStartOn(long startOn) {
1982 varun.gupt 1303
      this.startOn = startOn;
1304
      setStartOnIsSet(true);
1305
    }
1306
 
1307
    public void unsetStartOn() {
1308
      __isset_bit_vector.clear(__STARTON_ISSET_ID);
1309
    }
1310
 
3430 rajveer 1311
    /** Returns true if field startOn is set (has been assigned a value) and false otherwise */
1982 varun.gupt 1312
    public boolean isSetStartOn() {
1313
      return __isset_bit_vector.get(__STARTON_ISSET_ID);
1314
    }
1315
 
1316
    public void setStartOnIsSet(boolean value) {
1317
      __isset_bit_vector.set(__STARTON_ISSET_ID, value);
1318
    }
1319
 
1320
    public long getEndOn() {
1321
      return this.endOn;
1322
    }
1323
 
3430 rajveer 1324
    public void setEndOn(long endOn) {
1982 varun.gupt 1325
      this.endOn = endOn;
1326
      setEndOnIsSet(true);
1327
    }
1328
 
1329
    public void unsetEndOn() {
1330
      __isset_bit_vector.clear(__ENDON_ISSET_ID);
1331
    }
1332
 
3430 rajveer 1333
    /** Returns true if field endOn is set (has been assigned a value) and false otherwise */
1982 varun.gupt 1334
    public boolean isSetEndOn() {
1335
      return __isset_bit_vector.get(__ENDON_ISSET_ID);
1336
    }
1337
 
1338
    public void setEndOnIsSet(boolean value) {
1339
      __isset_bit_vector.set(__ENDON_ISSET_ID, value);
1340
    }
1341
 
1342
    public void setFieldValue(_Fields field, Object value) {
1343
      switch (field) {
1344
      case NAME:
1345
        if (value == null) {
1346
          unsetName();
1347
        } else {
1348
          setName((String)value);
1349
        }
1350
        break;
1351
 
1352
      case RULE_EXECUTION_SRC:
1353
        if (value == null) {
1354
          unsetRuleExecutionSrc();
1355
        } else {
1356
          setRuleExecutionSrc((String)value);
1357
        }
1358
        break;
1359
 
1360
      case START_ON:
1361
        if (value == null) {
1362
          unsetStartOn();
1363
        } else {
1364
          setStartOn((Long)value);
1365
        }
1366
        break;
1367
 
1368
      case END_ON:
1369
        if (value == null) {
1370
          unsetEndOn();
1371
        } else {
1372
          setEndOn((Long)value);
1373
        }
1374
        break;
1375
 
1376
      }
1377
    }
1378
 
1379
    public Object getFieldValue(_Fields field) {
1380
      switch (field) {
1381
      case NAME:
1382
        return getName();
1383
 
1384
      case RULE_EXECUTION_SRC:
1385
        return getRuleExecutionSrc();
1386
 
1387
      case START_ON:
3430 rajveer 1388
        return Long.valueOf(getStartOn());
1982 varun.gupt 1389
 
1390
      case END_ON:
3430 rajveer 1391
        return Long.valueOf(getEndOn());
1982 varun.gupt 1392
 
1393
      }
1394
      throw new IllegalStateException();
1395
    }
1396
 
3430 rajveer 1397
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
1398
    public boolean isSet(_Fields field) {
1399
      if (field == null) {
1400
        throw new IllegalArgumentException();
1401
      }
1982 varun.gupt 1402
 
1403
      switch (field) {
1404
      case NAME:
1405
        return isSetName();
1406
      case RULE_EXECUTION_SRC:
1407
        return isSetRuleExecutionSrc();
1408
      case START_ON:
1409
        return isSetStartOn();
1410
      case END_ON:
1411
        return isSetEndOn();
1412
      }
1413
      throw new IllegalStateException();
1414
    }
1415
 
1416
    @Override
1417
    public boolean equals(Object that) {
1418
      if (that == null)
1419
        return false;
1420
      if (that instanceof createPromotion_args)
1421
        return this.equals((createPromotion_args)that);
1422
      return false;
1423
    }
1424
 
1425
    public boolean equals(createPromotion_args that) {
1426
      if (that == null)
1427
        return false;
1428
 
1429
      boolean this_present_name = true && this.isSetName();
1430
      boolean that_present_name = true && that.isSetName();
1431
      if (this_present_name || that_present_name) {
1432
        if (!(this_present_name && that_present_name))
1433
          return false;
1434
        if (!this.name.equals(that.name))
1435
          return false;
1436
      }
1437
 
1438
      boolean this_present_ruleExecutionSrc = true && this.isSetRuleExecutionSrc();
1439
      boolean that_present_ruleExecutionSrc = true && that.isSetRuleExecutionSrc();
1440
      if (this_present_ruleExecutionSrc || that_present_ruleExecutionSrc) {
1441
        if (!(this_present_ruleExecutionSrc && that_present_ruleExecutionSrc))
1442
          return false;
1443
        if (!this.ruleExecutionSrc.equals(that.ruleExecutionSrc))
1444
          return false;
1445
      }
1446
 
1447
      boolean this_present_startOn = true;
1448
      boolean that_present_startOn = true;
1449
      if (this_present_startOn || that_present_startOn) {
1450
        if (!(this_present_startOn && that_present_startOn))
1451
          return false;
1452
        if (this.startOn != that.startOn)
1453
          return false;
1454
      }
1455
 
1456
      boolean this_present_endOn = true;
1457
      boolean that_present_endOn = true;
1458
      if (this_present_endOn || that_present_endOn) {
1459
        if (!(this_present_endOn && that_present_endOn))
1460
          return false;
1461
        if (this.endOn != that.endOn)
1462
          return false;
1463
      }
1464
 
1465
      return true;
1466
    }
1467
 
1468
    @Override
1469
    public int hashCode() {
1470
      return 0;
1471
    }
1472
 
1473
    public int compareTo(createPromotion_args other) {
1474
      if (!getClass().equals(other.getClass())) {
1475
        return getClass().getName().compareTo(other.getClass().getName());
1476
      }
1477
 
1478
      int lastComparison = 0;
1479
      createPromotion_args typedOther = (createPromotion_args)other;
1480
 
3430 rajveer 1481
      lastComparison = Boolean.valueOf(isSetName()).compareTo(typedOther.isSetName());
1982 varun.gupt 1482
      if (lastComparison != 0) {
1483
        return lastComparison;
1484
      }
3430 rajveer 1485
      if (isSetName()) {
1486
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, typedOther.name);
1487
        if (lastComparison != 0) {
1488
          return lastComparison;
1489
        }
1982 varun.gupt 1490
      }
3430 rajveer 1491
      lastComparison = Boolean.valueOf(isSetRuleExecutionSrc()).compareTo(typedOther.isSetRuleExecutionSrc());
1982 varun.gupt 1492
      if (lastComparison != 0) {
1493
        return lastComparison;
1494
      }
3430 rajveer 1495
      if (isSetRuleExecutionSrc()) {
1496
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ruleExecutionSrc, typedOther.ruleExecutionSrc);
1497
        if (lastComparison != 0) {
1498
          return lastComparison;
1499
        }
1982 varun.gupt 1500
      }
3430 rajveer 1501
      lastComparison = Boolean.valueOf(isSetStartOn()).compareTo(typedOther.isSetStartOn());
1982 varun.gupt 1502
      if (lastComparison != 0) {
1503
        return lastComparison;
1504
      }
3430 rajveer 1505
      if (isSetStartOn()) {
1506
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startOn, typedOther.startOn);
1507
        if (lastComparison != 0) {
1508
          return lastComparison;
1509
        }
1982 varun.gupt 1510
      }
3430 rajveer 1511
      lastComparison = Boolean.valueOf(isSetEndOn()).compareTo(typedOther.isSetEndOn());
1982 varun.gupt 1512
      if (lastComparison != 0) {
1513
        return lastComparison;
1514
      }
3430 rajveer 1515
      if (isSetEndOn()) {
1516
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endOn, typedOther.endOn);
1517
        if (lastComparison != 0) {
1518
          return lastComparison;
1519
        }
1982 varun.gupt 1520
      }
1521
      return 0;
1522
    }
1523
 
3430 rajveer 1524
    public _Fields fieldForId(int fieldId) {
1525
      return _Fields.findByThriftId(fieldId);
1526
    }
1527
 
1528
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
1529
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 1530
      iprot.readStructBegin();
1531
      while (true)
1532
      {
1533
        field = iprot.readFieldBegin();
3430 rajveer 1534
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 1535
          break;
1536
        }
3430 rajveer 1537
        switch (field.id) {
1538
          case 1: // NAME
1539
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
1540
              this.name = iprot.readString();
1541
            } else { 
1542
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1543
            }
1544
            break;
1545
          case 2: // RULE_EXECUTION_SRC
1546
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
1547
              this.ruleExecutionSrc = iprot.readString();
1548
            } else { 
1549
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1550
            }
1551
            break;
1552
          case 3: // START_ON
1553
            if (field.type == org.apache.thrift.protocol.TType.I64) {
1554
              this.startOn = iprot.readI64();
1555
              setStartOnIsSet(true);
1556
            } else { 
1557
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1558
            }
1559
            break;
1560
          case 4: // END_ON
1561
            if (field.type == org.apache.thrift.protocol.TType.I64) {
1562
              this.endOn = iprot.readI64();
1563
              setEndOnIsSet(true);
1564
            } else { 
1565
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1566
            }
1567
            break;
1568
          default:
1569
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 1570
        }
3430 rajveer 1571
        iprot.readFieldEnd();
1982 varun.gupt 1572
      }
1573
      iprot.readStructEnd();
1574
      validate();
1575
    }
1576
 
3430 rajveer 1577
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 1578
      validate();
1579
 
1580
      oprot.writeStructBegin(STRUCT_DESC);
1581
      if (this.name != null) {
1582
        oprot.writeFieldBegin(NAME_FIELD_DESC);
1583
        oprot.writeString(this.name);
1584
        oprot.writeFieldEnd();
1585
      }
1586
      if (this.ruleExecutionSrc != null) {
1587
        oprot.writeFieldBegin(RULE_EXECUTION_SRC_FIELD_DESC);
1588
        oprot.writeString(this.ruleExecutionSrc);
1589
        oprot.writeFieldEnd();
1590
      }
1591
      oprot.writeFieldBegin(START_ON_FIELD_DESC);
1592
      oprot.writeI64(this.startOn);
1593
      oprot.writeFieldEnd();
1594
      oprot.writeFieldBegin(END_ON_FIELD_DESC);
1595
      oprot.writeI64(this.endOn);
1596
      oprot.writeFieldEnd();
1597
      oprot.writeFieldStop();
1598
      oprot.writeStructEnd();
1599
    }
1600
 
1601
    @Override
1602
    public String toString() {
1603
      StringBuilder sb = new StringBuilder("createPromotion_args(");
1604
      boolean first = true;
1605
 
1606
      sb.append("name:");
1607
      if (this.name == null) {
1608
        sb.append("null");
1609
      } else {
1610
        sb.append(this.name);
1611
      }
1612
      first = false;
1613
      if (!first) sb.append(", ");
1614
      sb.append("ruleExecutionSrc:");
1615
      if (this.ruleExecutionSrc == null) {
1616
        sb.append("null");
1617
      } else {
1618
        sb.append(this.ruleExecutionSrc);
1619
      }
1620
      first = false;
1621
      if (!first) sb.append(", ");
1622
      sb.append("startOn:");
1623
      sb.append(this.startOn);
1624
      first = false;
1625
      if (!first) sb.append(", ");
1626
      sb.append("endOn:");
1627
      sb.append(this.endOn);
1628
      first = false;
1629
      sb.append(")");
1630
      return sb.toString();
1631
    }
1632
 
3430 rajveer 1633
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 1634
      // check for required fields
1635
    }
1636
 
3430 rajveer 1637
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
1638
      try {
1639
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
1640
      } catch (org.apache.thrift.TException te) {
1641
        throw new java.io.IOException(te);
1642
      }
1643
    }
1644
 
1645
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
1646
      try {
1647
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
1648
        __isset_bit_vector = new BitSet(1);
1649
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
1650
      } catch (org.apache.thrift.TException te) {
1651
        throw new java.io.IOException(te);
1652
      }
1653
    }
1654
 
1982 varun.gupt 1655
  }
1656
 
3430 rajveer 1657
  public static class createPromotion_result implements org.apache.thrift.TBase<createPromotion_result, createPromotion_result._Fields>, java.io.Serializable, Cloneable   {
1658
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createPromotion_result");
1982 varun.gupt 1659
 
3430 rajveer 1660
    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 1661
 
3430 rajveer 1662
    private PromotionException pex; // required
1982 varun.gupt 1663
 
1664
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 1665
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 1666
      PEX((short)1, "pex");
1667
 
1668
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
1669
 
1670
      static {
1671
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
1672
          byName.put(field.getFieldName(), field);
1673
        }
1674
      }
1675
 
1676
      /**
1677
       * Find the _Fields constant that matches fieldId, or null if its not found.
1678
       */
1679
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 1680
        switch(fieldId) {
1681
          case 1: // PEX
1682
            return PEX;
1683
          default:
1684
            return null;
1685
        }
1982 varun.gupt 1686
      }
1687
 
1688
      /**
1689
       * Find the _Fields constant that matches fieldId, throwing an exception
1690
       * if it is not found.
1691
       */
1692
      public static _Fields findByThriftIdOrThrow(int fieldId) {
1693
        _Fields fields = findByThriftId(fieldId);
1694
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
1695
        return fields;
1696
      }
1697
 
1698
      /**
1699
       * Find the _Fields constant that matches name, or null if its not found.
1700
       */
1701
      public static _Fields findByName(String name) {
1702
        return byName.get(name);
1703
      }
1704
 
1705
      private final short _thriftId;
1706
      private final String _fieldName;
1707
 
1708
      _Fields(short thriftId, String fieldName) {
1709
        _thriftId = thriftId;
1710
        _fieldName = fieldName;
1711
      }
1712
 
1713
      public short getThriftFieldId() {
1714
        return _thriftId;
1715
      }
1716
 
1717
      public String getFieldName() {
1718
        return _fieldName;
1719
      }
1720
    }
1721
 
1722
    // isset id assignments
1723
 
3430 rajveer 1724
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 1725
    static {
3430 rajveer 1726
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
1727
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
1728
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
1729
      metaDataMap = Collections.unmodifiableMap(tmpMap);
1730
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createPromotion_result.class, metaDataMap);
1982 varun.gupt 1731
    }
1732
 
1733
    public createPromotion_result() {
1734
    }
1735
 
1736
    public createPromotion_result(
1737
      PromotionException pex)
1738
    {
1739
      this();
1740
      this.pex = pex;
1741
    }
1742
 
1743
    /**
1744
     * Performs a deep copy on <i>other</i>.
1745
     */
1746
    public createPromotion_result(createPromotion_result other) {
1747
      if (other.isSetPex()) {
1748
        this.pex = new PromotionException(other.pex);
1749
      }
1750
    }
1751
 
1752
    public createPromotion_result deepCopy() {
1753
      return new createPromotion_result(this);
1754
    }
1755
 
3430 rajveer 1756
    @Override
1757
    public void clear() {
1758
      this.pex = null;
1982 varun.gupt 1759
    }
1760
 
1761
    public PromotionException getPex() {
1762
      return this.pex;
1763
    }
1764
 
3430 rajveer 1765
    public void setPex(PromotionException pex) {
1982 varun.gupt 1766
      this.pex = pex;
1767
    }
1768
 
1769
    public void unsetPex() {
1770
      this.pex = null;
1771
    }
1772
 
3430 rajveer 1773
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 1774
    public boolean isSetPex() {
1775
      return this.pex != null;
1776
    }
1777
 
1778
    public void setPexIsSet(boolean value) {
1779
      if (!value) {
1780
        this.pex = null;
1781
      }
1782
    }
1783
 
1784
    public void setFieldValue(_Fields field, Object value) {
1785
      switch (field) {
1786
      case PEX:
1787
        if (value == null) {
1788
          unsetPex();
1789
        } else {
1790
          setPex((PromotionException)value);
1791
        }
1792
        break;
1793
 
1794
      }
1795
    }
1796
 
1797
    public Object getFieldValue(_Fields field) {
1798
      switch (field) {
1799
      case PEX:
1800
        return getPex();
1801
 
1802
      }
1803
      throw new IllegalStateException();
1804
    }
1805
 
3430 rajveer 1806
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
1807
    public boolean isSet(_Fields field) {
1808
      if (field == null) {
1809
        throw new IllegalArgumentException();
1810
      }
1982 varun.gupt 1811
 
1812
      switch (field) {
1813
      case PEX:
1814
        return isSetPex();
1815
      }
1816
      throw new IllegalStateException();
1817
    }
1818
 
1819
    @Override
1820
    public boolean equals(Object that) {
1821
      if (that == null)
1822
        return false;
1823
      if (that instanceof createPromotion_result)
1824
        return this.equals((createPromotion_result)that);
1825
      return false;
1826
    }
1827
 
1828
    public boolean equals(createPromotion_result that) {
1829
      if (that == null)
1830
        return false;
1831
 
1832
      boolean this_present_pex = true && this.isSetPex();
1833
      boolean that_present_pex = true && that.isSetPex();
1834
      if (this_present_pex || that_present_pex) {
1835
        if (!(this_present_pex && that_present_pex))
1836
          return false;
1837
        if (!this.pex.equals(that.pex))
1838
          return false;
1839
      }
1840
 
1841
      return true;
1842
    }
1843
 
1844
    @Override
1845
    public int hashCode() {
1846
      return 0;
1847
    }
1848
 
1849
    public int compareTo(createPromotion_result other) {
1850
      if (!getClass().equals(other.getClass())) {
1851
        return getClass().getName().compareTo(other.getClass().getName());
1852
      }
1853
 
1854
      int lastComparison = 0;
1855
      createPromotion_result typedOther = (createPromotion_result)other;
1856
 
3430 rajveer 1857
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 1858
      if (lastComparison != 0) {
1859
        return lastComparison;
1860
      }
3430 rajveer 1861
      if (isSetPex()) {
1862
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
1863
        if (lastComparison != 0) {
1864
          return lastComparison;
1865
        }
1982 varun.gupt 1866
      }
1867
      return 0;
1868
    }
1869
 
3430 rajveer 1870
    public _Fields fieldForId(int fieldId) {
1871
      return _Fields.findByThriftId(fieldId);
1872
    }
1873
 
1874
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
1875
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 1876
      iprot.readStructBegin();
1877
      while (true)
1878
      {
1879
        field = iprot.readFieldBegin();
3430 rajveer 1880
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 1881
          break;
1882
        }
3430 rajveer 1883
        switch (field.id) {
1884
          case 1: // PEX
1885
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
1886
              this.pex = new PromotionException();
1887
              this.pex.read(iprot);
1888
            } else { 
1889
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1890
            }
1891
            break;
1892
          default:
1893
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 1894
        }
3430 rajveer 1895
        iprot.readFieldEnd();
1982 varun.gupt 1896
      }
1897
      iprot.readStructEnd();
1898
      validate();
1899
    }
1900
 
3430 rajveer 1901
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 1902
      oprot.writeStructBegin(STRUCT_DESC);
1903
 
1904
      if (this.isSetPex()) {
1905
        oprot.writeFieldBegin(PEX_FIELD_DESC);
1906
        this.pex.write(oprot);
1907
        oprot.writeFieldEnd();
1908
      }
1909
      oprot.writeFieldStop();
1910
      oprot.writeStructEnd();
1911
    }
1912
 
1913
    @Override
1914
    public String toString() {
1915
      StringBuilder sb = new StringBuilder("createPromotion_result(");
1916
      boolean first = true;
1917
 
1918
      sb.append("pex:");
1919
      if (this.pex == null) {
1920
        sb.append("null");
1921
      } else {
1922
        sb.append(this.pex);
1923
      }
1924
      first = false;
1925
      sb.append(")");
1926
      return sb.toString();
1927
    }
1928
 
3430 rajveer 1929
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 1930
      // check for required fields
1931
    }
1932
 
3430 rajveer 1933
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
1934
      try {
1935
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
1936
      } catch (org.apache.thrift.TException te) {
1937
        throw new java.io.IOException(te);
1938
      }
1939
    }
1940
 
1941
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
1942
      try {
1943
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
1944
      } catch (org.apache.thrift.TException te) {
1945
        throw new java.io.IOException(te);
1946
      }
1947
    }
1948
 
1982 varun.gupt 1949
  }
1950
 
3430 rajveer 1951
  public static class getAllPromotions_args implements org.apache.thrift.TBase<getAllPromotions_args, getAllPromotions_args._Fields>, java.io.Serializable, Cloneable   {
1952
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllPromotions_args");
1982 varun.gupt 1953
 
1954
 
1955
 
1956
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 1957
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 1958
;
1959
 
1960
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
1961
 
1962
      static {
1963
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
1964
          byName.put(field.getFieldName(), field);
1965
        }
1966
      }
1967
 
1968
      /**
1969
       * Find the _Fields constant that matches fieldId, or null if its not found.
1970
       */
1971
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 1972
        switch(fieldId) {
1973
          default:
1974
            return null;
1975
        }
1982 varun.gupt 1976
      }
1977
 
1978
      /**
1979
       * Find the _Fields constant that matches fieldId, throwing an exception
1980
       * if it is not found.
1981
       */
1982
      public static _Fields findByThriftIdOrThrow(int fieldId) {
1983
        _Fields fields = findByThriftId(fieldId);
1984
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
1985
        return fields;
1986
      }
1987
 
1988
      /**
1989
       * Find the _Fields constant that matches name, or null if its not found.
1990
       */
1991
      public static _Fields findByName(String name) {
1992
        return byName.get(name);
1993
      }
1994
 
1995
      private final short _thriftId;
1996
      private final String _fieldName;
1997
 
1998
      _Fields(short thriftId, String fieldName) {
1999
        _thriftId = thriftId;
2000
        _fieldName = fieldName;
2001
      }
2002
 
2003
      public short getThriftFieldId() {
2004
        return _thriftId;
2005
      }
2006
 
2007
      public String getFieldName() {
2008
        return _fieldName;
2009
      }
2010
    }
3430 rajveer 2011
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 2012
    static {
3430 rajveer 2013
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
2014
      metaDataMap = Collections.unmodifiableMap(tmpMap);
2015
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllPromotions_args.class, metaDataMap);
1982 varun.gupt 2016
    }
2017
 
2018
    public getAllPromotions_args() {
2019
    }
2020
 
2021
    /**
2022
     * Performs a deep copy on <i>other</i>.
2023
     */
2024
    public getAllPromotions_args(getAllPromotions_args other) {
2025
    }
2026
 
2027
    public getAllPromotions_args deepCopy() {
2028
      return new getAllPromotions_args(this);
2029
    }
2030
 
3430 rajveer 2031
    @Override
2032
    public void clear() {
1982 varun.gupt 2033
    }
2034
 
2035
    public void setFieldValue(_Fields field, Object value) {
2036
      switch (field) {
2037
      }
2038
    }
2039
 
2040
    public Object getFieldValue(_Fields field) {
2041
      switch (field) {
2042
      }
2043
      throw new IllegalStateException();
2044
    }
2045
 
3430 rajveer 2046
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
2047
    public boolean isSet(_Fields field) {
2048
      if (field == null) {
2049
        throw new IllegalArgumentException();
2050
      }
1982 varun.gupt 2051
 
2052
      switch (field) {
2053
      }
2054
      throw new IllegalStateException();
2055
    }
2056
 
2057
    @Override
2058
    public boolean equals(Object that) {
2059
      if (that == null)
2060
        return false;
2061
      if (that instanceof getAllPromotions_args)
2062
        return this.equals((getAllPromotions_args)that);
2063
      return false;
2064
    }
2065
 
2066
    public boolean equals(getAllPromotions_args that) {
2067
      if (that == null)
2068
        return false;
2069
 
2070
      return true;
2071
    }
2072
 
2073
    @Override
2074
    public int hashCode() {
2075
      return 0;
2076
    }
2077
 
2078
    public int compareTo(getAllPromotions_args other) {
2079
      if (!getClass().equals(other.getClass())) {
2080
        return getClass().getName().compareTo(other.getClass().getName());
2081
      }
2082
 
2083
      int lastComparison = 0;
2084
      getAllPromotions_args typedOther = (getAllPromotions_args)other;
2085
 
2086
      return 0;
2087
    }
2088
 
3430 rajveer 2089
    public _Fields fieldForId(int fieldId) {
2090
      return _Fields.findByThriftId(fieldId);
2091
    }
2092
 
2093
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
2094
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 2095
      iprot.readStructBegin();
2096
      while (true)
2097
      {
2098
        field = iprot.readFieldBegin();
3430 rajveer 2099
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 2100
          break;
2101
        }
3430 rajveer 2102
        switch (field.id) {
2103
          default:
2104
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 2105
        }
3430 rajveer 2106
        iprot.readFieldEnd();
1982 varun.gupt 2107
      }
2108
      iprot.readStructEnd();
2109
      validate();
2110
    }
2111
 
3430 rajveer 2112
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 2113
      validate();
2114
 
2115
      oprot.writeStructBegin(STRUCT_DESC);
2116
      oprot.writeFieldStop();
2117
      oprot.writeStructEnd();
2118
    }
2119
 
2120
    @Override
2121
    public String toString() {
2122
      StringBuilder sb = new StringBuilder("getAllPromotions_args(");
2123
      boolean first = true;
2124
 
2125
      sb.append(")");
2126
      return sb.toString();
2127
    }
2128
 
3430 rajveer 2129
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 2130
      // check for required fields
2131
    }
2132
 
3430 rajveer 2133
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
2134
      try {
2135
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
2136
      } catch (org.apache.thrift.TException te) {
2137
        throw new java.io.IOException(te);
2138
      }
2139
    }
2140
 
2141
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
2142
      try {
2143
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
2144
      } catch (org.apache.thrift.TException te) {
2145
        throw new java.io.IOException(te);
2146
      }
2147
    }
2148
 
1982 varun.gupt 2149
  }
2150
 
3430 rajveer 2151
  public static class getAllPromotions_result implements org.apache.thrift.TBase<getAllPromotions_result, getAllPromotions_result._Fields>, java.io.Serializable, Cloneable   {
2152
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllPromotions_result");
1982 varun.gupt 2153
 
3430 rajveer 2154
    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);
2155
    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 2156
 
3430 rajveer 2157
    private List<Promotion> success; // required
2158
    private PromotionException pex; // required
1982 varun.gupt 2159
 
2160
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 2161
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 2162
      SUCCESS((short)0, "success"),
2163
      PEX((short)1, "pex");
2164
 
2165
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2166
 
2167
      static {
2168
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2169
          byName.put(field.getFieldName(), field);
2170
        }
2171
      }
2172
 
2173
      /**
2174
       * Find the _Fields constant that matches fieldId, or null if its not found.
2175
       */
2176
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 2177
        switch(fieldId) {
2178
          case 0: // SUCCESS
2179
            return SUCCESS;
2180
          case 1: // PEX
2181
            return PEX;
2182
          default:
2183
            return null;
2184
        }
1982 varun.gupt 2185
      }
2186
 
2187
      /**
2188
       * Find the _Fields constant that matches fieldId, throwing an exception
2189
       * if it is not found.
2190
       */
2191
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2192
        _Fields fields = findByThriftId(fieldId);
2193
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2194
        return fields;
2195
      }
2196
 
2197
      /**
2198
       * Find the _Fields constant that matches name, or null if its not found.
2199
       */
2200
      public static _Fields findByName(String name) {
2201
        return byName.get(name);
2202
      }
2203
 
2204
      private final short _thriftId;
2205
      private final String _fieldName;
2206
 
2207
      _Fields(short thriftId, String fieldName) {
2208
        _thriftId = thriftId;
2209
        _fieldName = fieldName;
2210
      }
2211
 
2212
      public short getThriftFieldId() {
2213
        return _thriftId;
2214
      }
2215
 
2216
      public String getFieldName() {
2217
        return _fieldName;
2218
      }
2219
    }
2220
 
2221
    // isset id assignments
2222
 
3430 rajveer 2223
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 2224
    static {
3430 rajveer 2225
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
2226
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2227
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
2228
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Promotion.class))));
2229
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2230
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
2231
      metaDataMap = Collections.unmodifiableMap(tmpMap);
2232
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllPromotions_result.class, metaDataMap);
1982 varun.gupt 2233
    }
2234
 
2235
    public getAllPromotions_result() {
2236
    }
2237
 
2238
    public getAllPromotions_result(
2239
      List<Promotion> success,
2240
      PromotionException pex)
2241
    {
2242
      this();
2243
      this.success = success;
2244
      this.pex = pex;
2245
    }
2246
 
2247
    /**
2248
     * Performs a deep copy on <i>other</i>.
2249
     */
2250
    public getAllPromotions_result(getAllPromotions_result other) {
2251
      if (other.isSetSuccess()) {
2252
        List<Promotion> __this__success = new ArrayList<Promotion>();
2253
        for (Promotion other_element : other.success) {
2254
          __this__success.add(new Promotion(other_element));
2255
        }
2256
        this.success = __this__success;
2257
      }
2258
      if (other.isSetPex()) {
2259
        this.pex = new PromotionException(other.pex);
2260
      }
2261
    }
2262
 
2263
    public getAllPromotions_result deepCopy() {
2264
      return new getAllPromotions_result(this);
2265
    }
2266
 
3430 rajveer 2267
    @Override
2268
    public void clear() {
2269
      this.success = null;
2270
      this.pex = null;
1982 varun.gupt 2271
    }
2272
 
2273
    public int getSuccessSize() {
2274
      return (this.success == null) ? 0 : this.success.size();
2275
    }
2276
 
2277
    public java.util.Iterator<Promotion> getSuccessIterator() {
2278
      return (this.success == null) ? null : this.success.iterator();
2279
    }
2280
 
2281
    public void addToSuccess(Promotion elem) {
2282
      if (this.success == null) {
2283
        this.success = new ArrayList<Promotion>();
2284
      }
2285
      this.success.add(elem);
2286
    }
2287
 
2288
    public List<Promotion> getSuccess() {
2289
      return this.success;
2290
    }
2291
 
3430 rajveer 2292
    public void setSuccess(List<Promotion> success) {
1982 varun.gupt 2293
      this.success = success;
2294
    }
2295
 
2296
    public void unsetSuccess() {
2297
      this.success = null;
2298
    }
2299
 
3430 rajveer 2300
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2301
    public boolean isSetSuccess() {
2302
      return this.success != null;
2303
    }
2304
 
2305
    public void setSuccessIsSet(boolean value) {
2306
      if (!value) {
2307
        this.success = null;
2308
      }
2309
    }
2310
 
2311
    public PromotionException getPex() {
2312
      return this.pex;
2313
    }
2314
 
3430 rajveer 2315
    public void setPex(PromotionException pex) {
1982 varun.gupt 2316
      this.pex = pex;
2317
    }
2318
 
2319
    public void unsetPex() {
2320
      this.pex = null;
2321
    }
2322
 
3430 rajveer 2323
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2324
    public boolean isSetPex() {
2325
      return this.pex != null;
2326
    }
2327
 
2328
    public void setPexIsSet(boolean value) {
2329
      if (!value) {
2330
        this.pex = null;
2331
      }
2332
    }
2333
 
2334
    public void setFieldValue(_Fields field, Object value) {
2335
      switch (field) {
2336
      case SUCCESS:
2337
        if (value == null) {
2338
          unsetSuccess();
2339
        } else {
2340
          setSuccess((List<Promotion>)value);
2341
        }
2342
        break;
2343
 
2344
      case PEX:
2345
        if (value == null) {
2346
          unsetPex();
2347
        } else {
2348
          setPex((PromotionException)value);
2349
        }
2350
        break;
2351
 
2352
      }
2353
    }
2354
 
2355
    public Object getFieldValue(_Fields field) {
2356
      switch (field) {
2357
      case SUCCESS:
2358
        return getSuccess();
2359
 
2360
      case PEX:
2361
        return getPex();
2362
 
2363
      }
2364
      throw new IllegalStateException();
2365
    }
2366
 
3430 rajveer 2367
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
2368
    public boolean isSet(_Fields field) {
2369
      if (field == null) {
2370
        throw new IllegalArgumentException();
2371
      }
1982 varun.gupt 2372
 
2373
      switch (field) {
2374
      case SUCCESS:
2375
        return isSetSuccess();
2376
      case PEX:
2377
        return isSetPex();
2378
      }
2379
      throw new IllegalStateException();
2380
    }
2381
 
2382
    @Override
2383
    public boolean equals(Object that) {
2384
      if (that == null)
2385
        return false;
2386
      if (that instanceof getAllPromotions_result)
2387
        return this.equals((getAllPromotions_result)that);
2388
      return false;
2389
    }
2390
 
2391
    public boolean equals(getAllPromotions_result that) {
2392
      if (that == null)
2393
        return false;
2394
 
2395
      boolean this_present_success = true && this.isSetSuccess();
2396
      boolean that_present_success = true && that.isSetSuccess();
2397
      if (this_present_success || that_present_success) {
2398
        if (!(this_present_success && that_present_success))
2399
          return false;
2400
        if (!this.success.equals(that.success))
2401
          return false;
2402
      }
2403
 
2404
      boolean this_present_pex = true && this.isSetPex();
2405
      boolean that_present_pex = true && that.isSetPex();
2406
      if (this_present_pex || that_present_pex) {
2407
        if (!(this_present_pex && that_present_pex))
2408
          return false;
2409
        if (!this.pex.equals(that.pex))
2410
          return false;
2411
      }
2412
 
2413
      return true;
2414
    }
2415
 
2416
    @Override
2417
    public int hashCode() {
2418
      return 0;
2419
    }
2420
 
2421
    public int compareTo(getAllPromotions_result other) {
2422
      if (!getClass().equals(other.getClass())) {
2423
        return getClass().getName().compareTo(other.getClass().getName());
2424
      }
2425
 
2426
      int lastComparison = 0;
2427
      getAllPromotions_result typedOther = (getAllPromotions_result)other;
2428
 
3430 rajveer 2429
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 2430
      if (lastComparison != 0) {
2431
        return lastComparison;
2432
      }
3430 rajveer 2433
      if (isSetSuccess()) {
2434
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
2435
        if (lastComparison != 0) {
2436
          return lastComparison;
2437
        }
1982 varun.gupt 2438
      }
3430 rajveer 2439
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 2440
      if (lastComparison != 0) {
2441
        return lastComparison;
2442
      }
3430 rajveer 2443
      if (isSetPex()) {
2444
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
2445
        if (lastComparison != 0) {
2446
          return lastComparison;
2447
        }
1982 varun.gupt 2448
      }
2449
      return 0;
2450
    }
2451
 
3430 rajveer 2452
    public _Fields fieldForId(int fieldId) {
2453
      return _Fields.findByThriftId(fieldId);
2454
    }
2455
 
2456
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
2457
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 2458
      iprot.readStructBegin();
2459
      while (true)
2460
      {
2461
        field = iprot.readFieldBegin();
3430 rajveer 2462
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 2463
          break;
2464
        }
3430 rajveer 2465
        switch (field.id) {
2466
          case 0: // SUCCESS
2467
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
2468
              {
5327 rajveer 2469
                org.apache.thrift.protocol.TList _list12 = iprot.readListBegin();
2470
                this.success = new ArrayList<Promotion>(_list12.size);
2471
                for (int _i13 = 0; _i13 < _list12.size; ++_i13)
1982 varun.gupt 2472
                {
5327 rajveer 2473
                  Promotion _elem14; // required
2474
                  _elem14 = new Promotion();
2475
                  _elem14.read(iprot);
2476
                  this.success.add(_elem14);
1982 varun.gupt 2477
                }
3430 rajveer 2478
                iprot.readListEnd();
1982 varun.gupt 2479
              }
3430 rajveer 2480
            } else { 
2481
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2482
            }
2483
            break;
2484
          case 1: // PEX
2485
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
2486
              this.pex = new PromotionException();
2487
              this.pex.read(iprot);
2488
            } else { 
2489
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2490
            }
2491
            break;
2492
          default:
2493
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 2494
        }
3430 rajveer 2495
        iprot.readFieldEnd();
1982 varun.gupt 2496
      }
2497
      iprot.readStructEnd();
2498
      validate();
2499
    }
2500
 
3430 rajveer 2501
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 2502
      oprot.writeStructBegin(STRUCT_DESC);
2503
 
2504
      if (this.isSetSuccess()) {
2505
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
2506
        {
3430 rajveer 2507
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
5327 rajveer 2508
          for (Promotion _iter15 : this.success)
1982 varun.gupt 2509
          {
5327 rajveer 2510
            _iter15.write(oprot);
1982 varun.gupt 2511
          }
2512
          oprot.writeListEnd();
2513
        }
2514
        oprot.writeFieldEnd();
2515
      } else if (this.isSetPex()) {
2516
        oprot.writeFieldBegin(PEX_FIELD_DESC);
2517
        this.pex.write(oprot);
2518
        oprot.writeFieldEnd();
2519
      }
2520
      oprot.writeFieldStop();
2521
      oprot.writeStructEnd();
2522
    }
2523
 
2524
    @Override
2525
    public String toString() {
2526
      StringBuilder sb = new StringBuilder("getAllPromotions_result(");
2527
      boolean first = true;
2528
 
2529
      sb.append("success:");
2530
      if (this.success == null) {
2531
        sb.append("null");
2532
      } else {
2533
        sb.append(this.success);
2534
      }
2535
      first = false;
2536
      if (!first) sb.append(", ");
2537
      sb.append("pex:");
2538
      if (this.pex == null) {
2539
        sb.append("null");
2540
      } else {
2541
        sb.append(this.pex);
2542
      }
2543
      first = false;
2544
      sb.append(")");
2545
      return sb.toString();
2546
    }
2547
 
3430 rajveer 2548
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 2549
      // check for required fields
2550
    }
2551
 
3430 rajveer 2552
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
2553
      try {
2554
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
2555
      } catch (org.apache.thrift.TException te) {
2556
        throw new java.io.IOException(te);
2557
      }
2558
    }
2559
 
2560
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
2561
      try {
2562
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
2563
      } catch (org.apache.thrift.TException te) {
2564
        throw new java.io.IOException(te);
2565
      }
2566
    }
2567
 
1982 varun.gupt 2568
  }
2569
 
3430 rajveer 2570
  public static class getPromotionById_args implements org.apache.thrift.TBase<getPromotionById_args, getPromotionById_args._Fields>, java.io.Serializable, Cloneable   {
2571
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPromotionById_args");
1982 varun.gupt 2572
 
3430 rajveer 2573
    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 2574
 
3430 rajveer 2575
    private long promotionId; // required
1982 varun.gupt 2576
 
2577
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 2578
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 2579
      PROMOTION_ID((short)1, "promotionId");
2580
 
2581
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2582
 
2583
      static {
2584
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2585
          byName.put(field.getFieldName(), field);
2586
        }
2587
      }
2588
 
2589
      /**
2590
       * Find the _Fields constant that matches fieldId, or null if its not found.
2591
       */
2592
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 2593
        switch(fieldId) {
2594
          case 1: // PROMOTION_ID
2595
            return PROMOTION_ID;
2596
          default:
2597
            return null;
2598
        }
1982 varun.gupt 2599
      }
2600
 
2601
      /**
2602
       * Find the _Fields constant that matches fieldId, throwing an exception
2603
       * if it is not found.
2604
       */
2605
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2606
        _Fields fields = findByThriftId(fieldId);
2607
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2608
        return fields;
2609
      }
2610
 
2611
      /**
2612
       * Find the _Fields constant that matches name, or null if its not found.
2613
       */
2614
      public static _Fields findByName(String name) {
2615
        return byName.get(name);
2616
      }
2617
 
2618
      private final short _thriftId;
2619
      private final String _fieldName;
2620
 
2621
      _Fields(short thriftId, String fieldName) {
2622
        _thriftId = thriftId;
2623
        _fieldName = fieldName;
2624
      }
2625
 
2626
      public short getThriftFieldId() {
2627
        return _thriftId;
2628
      }
2629
 
2630
      public String getFieldName() {
2631
        return _fieldName;
2632
      }
2633
    }
2634
 
2635
    // isset id assignments
2636
    private static final int __PROMOTIONID_ISSET_ID = 0;
2637
    private BitSet __isset_bit_vector = new BitSet(1);
2638
 
3430 rajveer 2639
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 2640
    static {
3430 rajveer 2641
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
2642
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2643
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
2644
      metaDataMap = Collections.unmodifiableMap(tmpMap);
2645
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPromotionById_args.class, metaDataMap);
1982 varun.gupt 2646
    }
2647
 
2648
    public getPromotionById_args() {
2649
    }
2650
 
2651
    public getPromotionById_args(
2652
      long promotionId)
2653
    {
2654
      this();
2655
      this.promotionId = promotionId;
2656
      setPromotionIdIsSet(true);
2657
    }
2658
 
2659
    /**
2660
     * Performs a deep copy on <i>other</i>.
2661
     */
2662
    public getPromotionById_args(getPromotionById_args other) {
2663
      __isset_bit_vector.clear();
2664
      __isset_bit_vector.or(other.__isset_bit_vector);
2665
      this.promotionId = other.promotionId;
2666
    }
2667
 
2668
    public getPromotionById_args deepCopy() {
2669
      return new getPromotionById_args(this);
2670
    }
2671
 
3430 rajveer 2672
    @Override
2673
    public void clear() {
2674
      setPromotionIdIsSet(false);
2675
      this.promotionId = 0;
1982 varun.gupt 2676
    }
2677
 
2678
    public long getPromotionId() {
2679
      return this.promotionId;
2680
    }
2681
 
3430 rajveer 2682
    public void setPromotionId(long promotionId) {
1982 varun.gupt 2683
      this.promotionId = promotionId;
2684
      setPromotionIdIsSet(true);
2685
    }
2686
 
2687
    public void unsetPromotionId() {
2688
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
2689
    }
2690
 
3430 rajveer 2691
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2692
    public boolean isSetPromotionId() {
2693
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
2694
    }
2695
 
2696
    public void setPromotionIdIsSet(boolean value) {
2697
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
2698
    }
2699
 
2700
    public void setFieldValue(_Fields field, Object value) {
2701
      switch (field) {
2702
      case PROMOTION_ID:
2703
        if (value == null) {
2704
          unsetPromotionId();
2705
        } else {
2706
          setPromotionId((Long)value);
2707
        }
2708
        break;
2709
 
2710
      }
2711
    }
2712
 
2713
    public Object getFieldValue(_Fields field) {
2714
      switch (field) {
2715
      case PROMOTION_ID:
3430 rajveer 2716
        return Long.valueOf(getPromotionId());
1982 varun.gupt 2717
 
2718
      }
2719
      throw new IllegalStateException();
2720
    }
2721
 
3430 rajveer 2722
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
2723
    public boolean isSet(_Fields field) {
2724
      if (field == null) {
2725
        throw new IllegalArgumentException();
2726
      }
1982 varun.gupt 2727
 
2728
      switch (field) {
2729
      case PROMOTION_ID:
2730
        return isSetPromotionId();
2731
      }
2732
      throw new IllegalStateException();
2733
    }
2734
 
2735
    @Override
2736
    public boolean equals(Object that) {
2737
      if (that == null)
2738
        return false;
2739
      if (that instanceof getPromotionById_args)
2740
        return this.equals((getPromotionById_args)that);
2741
      return false;
2742
    }
2743
 
2744
    public boolean equals(getPromotionById_args that) {
2745
      if (that == null)
2746
        return false;
2747
 
2748
      boolean this_present_promotionId = true;
2749
      boolean that_present_promotionId = true;
2750
      if (this_present_promotionId || that_present_promotionId) {
2751
        if (!(this_present_promotionId && that_present_promotionId))
2752
          return false;
2753
        if (this.promotionId != that.promotionId)
2754
          return false;
2755
      }
2756
 
2757
      return true;
2758
    }
2759
 
2760
    @Override
2761
    public int hashCode() {
2762
      return 0;
2763
    }
2764
 
2765
    public int compareTo(getPromotionById_args other) {
2766
      if (!getClass().equals(other.getClass())) {
2767
        return getClass().getName().compareTo(other.getClass().getName());
2768
      }
2769
 
2770
      int lastComparison = 0;
2771
      getPromotionById_args typedOther = (getPromotionById_args)other;
2772
 
3430 rajveer 2773
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
1982 varun.gupt 2774
      if (lastComparison != 0) {
2775
        return lastComparison;
2776
      }
3430 rajveer 2777
      if (isSetPromotionId()) {
2778
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
2779
        if (lastComparison != 0) {
2780
          return lastComparison;
2781
        }
1982 varun.gupt 2782
      }
2783
      return 0;
2784
    }
2785
 
3430 rajveer 2786
    public _Fields fieldForId(int fieldId) {
2787
      return _Fields.findByThriftId(fieldId);
2788
    }
2789
 
2790
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
2791
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 2792
      iprot.readStructBegin();
2793
      while (true)
2794
      {
2795
        field = iprot.readFieldBegin();
3430 rajveer 2796
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 2797
          break;
2798
        }
3430 rajveer 2799
        switch (field.id) {
2800
          case 1: // PROMOTION_ID
2801
            if (field.type == org.apache.thrift.protocol.TType.I64) {
2802
              this.promotionId = iprot.readI64();
2803
              setPromotionIdIsSet(true);
2804
            } else { 
2805
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2806
            }
2807
            break;
2808
          default:
2809
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 2810
        }
3430 rajveer 2811
        iprot.readFieldEnd();
1982 varun.gupt 2812
      }
2813
      iprot.readStructEnd();
2814
      validate();
2815
    }
2816
 
3430 rajveer 2817
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 2818
      validate();
2819
 
2820
      oprot.writeStructBegin(STRUCT_DESC);
2821
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
2822
      oprot.writeI64(this.promotionId);
2823
      oprot.writeFieldEnd();
2824
      oprot.writeFieldStop();
2825
      oprot.writeStructEnd();
2826
    }
2827
 
2828
    @Override
2829
    public String toString() {
2830
      StringBuilder sb = new StringBuilder("getPromotionById_args(");
2831
      boolean first = true;
2832
 
2833
      sb.append("promotionId:");
2834
      sb.append(this.promotionId);
2835
      first = false;
2836
      sb.append(")");
2837
      return sb.toString();
2838
    }
2839
 
3430 rajveer 2840
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 2841
      // check for required fields
2842
    }
2843
 
3430 rajveer 2844
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
2845
      try {
2846
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
2847
      } catch (org.apache.thrift.TException te) {
2848
        throw new java.io.IOException(te);
2849
      }
2850
    }
2851
 
2852
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
2853
      try {
2854
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
2855
        __isset_bit_vector = new BitSet(1);
2856
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
2857
      } catch (org.apache.thrift.TException te) {
2858
        throw new java.io.IOException(te);
2859
      }
2860
    }
2861
 
1982 varun.gupt 2862
  }
2863
 
3430 rajveer 2864
  public static class getPromotionById_result implements org.apache.thrift.TBase<getPromotionById_result, getPromotionById_result._Fields>, java.io.Serializable, Cloneable   {
2865
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPromotionById_result");
1982 varun.gupt 2866
 
3430 rajveer 2867
    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);
2868
    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 2869
 
3430 rajveer 2870
    private Promotion success; // required
2871
    private PromotionException pex; // required
1982 varun.gupt 2872
 
2873
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 2874
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 2875
      SUCCESS((short)0, "success"),
2876
      PEX((short)1, "pex");
2877
 
2878
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2879
 
2880
      static {
2881
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2882
          byName.put(field.getFieldName(), field);
2883
        }
2884
      }
2885
 
2886
      /**
2887
       * Find the _Fields constant that matches fieldId, or null if its not found.
2888
       */
2889
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 2890
        switch(fieldId) {
2891
          case 0: // SUCCESS
2892
            return SUCCESS;
2893
          case 1: // PEX
2894
            return PEX;
2895
          default:
2896
            return null;
2897
        }
1982 varun.gupt 2898
      }
2899
 
2900
      /**
2901
       * Find the _Fields constant that matches fieldId, throwing an exception
2902
       * if it is not found.
2903
       */
2904
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2905
        _Fields fields = findByThriftId(fieldId);
2906
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2907
        return fields;
2908
      }
2909
 
2910
      /**
2911
       * Find the _Fields constant that matches name, or null if its not found.
2912
       */
2913
      public static _Fields findByName(String name) {
2914
        return byName.get(name);
2915
      }
2916
 
2917
      private final short _thriftId;
2918
      private final String _fieldName;
2919
 
2920
      _Fields(short thriftId, String fieldName) {
2921
        _thriftId = thriftId;
2922
        _fieldName = fieldName;
2923
      }
2924
 
2925
      public short getThriftFieldId() {
2926
        return _thriftId;
2927
      }
2928
 
2929
      public String getFieldName() {
2930
        return _fieldName;
2931
      }
2932
    }
2933
 
2934
    // isset id assignments
2935
 
3430 rajveer 2936
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 2937
    static {
3430 rajveer 2938
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
2939
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2940
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Promotion.class)));
2941
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2942
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
2943
      metaDataMap = Collections.unmodifiableMap(tmpMap);
2944
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPromotionById_result.class, metaDataMap);
1982 varun.gupt 2945
    }
2946
 
2947
    public getPromotionById_result() {
2948
    }
2949
 
2950
    public getPromotionById_result(
2951
      Promotion success,
2952
      PromotionException pex)
2953
    {
2954
      this();
2955
      this.success = success;
2956
      this.pex = pex;
2957
    }
2958
 
2959
    /**
2960
     * Performs a deep copy on <i>other</i>.
2961
     */
2962
    public getPromotionById_result(getPromotionById_result other) {
2963
      if (other.isSetSuccess()) {
2964
        this.success = new Promotion(other.success);
2965
      }
2966
      if (other.isSetPex()) {
2967
        this.pex = new PromotionException(other.pex);
2968
      }
2969
    }
2970
 
2971
    public getPromotionById_result deepCopy() {
2972
      return new getPromotionById_result(this);
2973
    }
2974
 
3430 rajveer 2975
    @Override
2976
    public void clear() {
2977
      this.success = null;
2978
      this.pex = null;
1982 varun.gupt 2979
    }
2980
 
2981
    public Promotion getSuccess() {
2982
      return this.success;
2983
    }
2984
 
3430 rajveer 2985
    public void setSuccess(Promotion success) {
1982 varun.gupt 2986
      this.success = success;
2987
    }
2988
 
2989
    public void unsetSuccess() {
2990
      this.success = null;
2991
    }
2992
 
3430 rajveer 2993
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2994
    public boolean isSetSuccess() {
2995
      return this.success != null;
2996
    }
2997
 
2998
    public void setSuccessIsSet(boolean value) {
2999
      if (!value) {
3000
        this.success = null;
3001
      }
3002
    }
3003
 
3004
    public PromotionException getPex() {
3005
      return this.pex;
3006
    }
3007
 
3430 rajveer 3008
    public void setPex(PromotionException pex) {
1982 varun.gupt 3009
      this.pex = pex;
3010
    }
3011
 
3012
    public void unsetPex() {
3013
      this.pex = null;
3014
    }
3015
 
3430 rajveer 3016
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 3017
    public boolean isSetPex() {
3018
      return this.pex != null;
3019
    }
3020
 
3021
    public void setPexIsSet(boolean value) {
3022
      if (!value) {
3023
        this.pex = null;
3024
      }
3025
    }
3026
 
3027
    public void setFieldValue(_Fields field, Object value) {
3028
      switch (field) {
3029
      case SUCCESS:
3030
        if (value == null) {
3031
          unsetSuccess();
3032
        } else {
3033
          setSuccess((Promotion)value);
3034
        }
3035
        break;
3036
 
3037
      case PEX:
3038
        if (value == null) {
3039
          unsetPex();
3040
        } else {
3041
          setPex((PromotionException)value);
3042
        }
3043
        break;
3044
 
3045
      }
3046
    }
3047
 
3048
    public Object getFieldValue(_Fields field) {
3049
      switch (field) {
3050
      case SUCCESS:
3051
        return getSuccess();
3052
 
3053
      case PEX:
3054
        return getPex();
3055
 
3056
      }
3057
      throw new IllegalStateException();
3058
    }
3059
 
3430 rajveer 3060
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
3061
    public boolean isSet(_Fields field) {
3062
      if (field == null) {
3063
        throw new IllegalArgumentException();
3064
      }
1982 varun.gupt 3065
 
3066
      switch (field) {
3067
      case SUCCESS:
3068
        return isSetSuccess();
3069
      case PEX:
3070
        return isSetPex();
3071
      }
3072
      throw new IllegalStateException();
3073
    }
3074
 
3075
    @Override
3076
    public boolean equals(Object that) {
3077
      if (that == null)
3078
        return false;
3079
      if (that instanceof getPromotionById_result)
3080
        return this.equals((getPromotionById_result)that);
3081
      return false;
3082
    }
3083
 
3084
    public boolean equals(getPromotionById_result that) {
3085
      if (that == null)
3086
        return false;
3087
 
3088
      boolean this_present_success = true && this.isSetSuccess();
3089
      boolean that_present_success = true && that.isSetSuccess();
3090
      if (this_present_success || that_present_success) {
3091
        if (!(this_present_success && that_present_success))
3092
          return false;
3093
        if (!this.success.equals(that.success))
3094
          return false;
3095
      }
3096
 
3097
      boolean this_present_pex = true && this.isSetPex();
3098
      boolean that_present_pex = true && that.isSetPex();
3099
      if (this_present_pex || that_present_pex) {
3100
        if (!(this_present_pex && that_present_pex))
3101
          return false;
3102
        if (!this.pex.equals(that.pex))
3103
          return false;
3104
      }
3105
 
3106
      return true;
3107
    }
3108
 
3109
    @Override
3110
    public int hashCode() {
3111
      return 0;
3112
    }
3113
 
3114
    public int compareTo(getPromotionById_result other) {
3115
      if (!getClass().equals(other.getClass())) {
3116
        return getClass().getName().compareTo(other.getClass().getName());
3117
      }
3118
 
3119
      int lastComparison = 0;
3120
      getPromotionById_result typedOther = (getPromotionById_result)other;
3121
 
3430 rajveer 3122
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 3123
      if (lastComparison != 0) {
3124
        return lastComparison;
3125
      }
3430 rajveer 3126
      if (isSetSuccess()) {
3127
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
3128
        if (lastComparison != 0) {
3129
          return lastComparison;
3130
        }
1982 varun.gupt 3131
      }
3430 rajveer 3132
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 3133
      if (lastComparison != 0) {
3134
        return lastComparison;
3135
      }
3430 rajveer 3136
      if (isSetPex()) {
3137
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
3138
        if (lastComparison != 0) {
3139
          return lastComparison;
3140
        }
1982 varun.gupt 3141
      }
3142
      return 0;
3143
    }
3144
 
3430 rajveer 3145
    public _Fields fieldForId(int fieldId) {
3146
      return _Fields.findByThriftId(fieldId);
3147
    }
3148
 
3149
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
3150
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 3151
      iprot.readStructBegin();
3152
      while (true)
3153
      {
3154
        field = iprot.readFieldBegin();
3430 rajveer 3155
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 3156
          break;
3157
        }
3430 rajveer 3158
        switch (field.id) {
3159
          case 0: // SUCCESS
3160
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
3161
              this.success = new Promotion();
3162
              this.success.read(iprot);
3163
            } else { 
3164
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3165
            }
3166
            break;
3167
          case 1: // PEX
3168
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
3169
              this.pex = new PromotionException();
3170
              this.pex.read(iprot);
3171
            } else { 
3172
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3173
            }
3174
            break;
3175
          default:
3176
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 3177
        }
3430 rajveer 3178
        iprot.readFieldEnd();
1982 varun.gupt 3179
      }
3180
      iprot.readStructEnd();
3181
      validate();
3182
    }
3183
 
3430 rajveer 3184
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 3185
      oprot.writeStructBegin(STRUCT_DESC);
3186
 
3187
      if (this.isSetSuccess()) {
3188
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
3189
        this.success.write(oprot);
3190
        oprot.writeFieldEnd();
3191
      } else if (this.isSetPex()) {
3192
        oprot.writeFieldBegin(PEX_FIELD_DESC);
3193
        this.pex.write(oprot);
3194
        oprot.writeFieldEnd();
3195
      }
3196
      oprot.writeFieldStop();
3197
      oprot.writeStructEnd();
3198
    }
3199
 
3200
    @Override
3201
    public String toString() {
3202
      StringBuilder sb = new StringBuilder("getPromotionById_result(");
3203
      boolean first = true;
3204
 
3205
      sb.append("success:");
3206
      if (this.success == null) {
3207
        sb.append("null");
3208
      } else {
3209
        sb.append(this.success);
3210
      }
3211
      first = false;
3212
      if (!first) sb.append(", ");
3213
      sb.append("pex:");
3214
      if (this.pex == null) {
3215
        sb.append("null");
3216
      } else {
3217
        sb.append(this.pex);
3218
      }
3219
      first = false;
3220
      sb.append(")");
3221
      return sb.toString();
3222
    }
3223
 
3430 rajveer 3224
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 3225
      // check for required fields
3226
    }
3227
 
3430 rajveer 3228
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
3229
      try {
3230
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
3231
      } catch (org.apache.thrift.TException te) {
3232
        throw new java.io.IOException(te);
3233
      }
3234
    }
3235
 
3236
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
3237
      try {
3238
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
3239
      } catch (org.apache.thrift.TException te) {
3240
        throw new java.io.IOException(te);
3241
      }
3242
    }
3243
 
1982 varun.gupt 3244
  }
3245
 
3430 rajveer 3246
  public static class generateCouponsForPromotion_args implements org.apache.thrift.TBase<generateCouponsForPromotion_args, generateCouponsForPromotion_args._Fields>, java.io.Serializable, Cloneable   {
3247
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("generateCouponsForPromotion_args");
1982 varun.gupt 3248
 
3430 rajveer 3249
    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);
3250
    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 3251
 
3430 rajveer 3252
    private long promotionId; // required
3253
    private String couponCode; // required
1982 varun.gupt 3254
 
3255
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 3256
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 3257
      PROMOTION_ID((short)1, "promotionId"),
3258
      COUPON_CODE((short)2, "couponCode");
3259
 
3260
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3261
 
3262
      static {
3263
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3264
          byName.put(field.getFieldName(), field);
3265
        }
3266
      }
3267
 
3268
      /**
3269
       * Find the _Fields constant that matches fieldId, or null if its not found.
3270
       */
3271
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 3272
        switch(fieldId) {
3273
          case 1: // PROMOTION_ID
3274
            return PROMOTION_ID;
3275
          case 2: // COUPON_CODE
3276
            return COUPON_CODE;
3277
          default:
3278
            return null;
3279
        }
1982 varun.gupt 3280
      }
3281
 
3282
      /**
3283
       * Find the _Fields constant that matches fieldId, throwing an exception
3284
       * if it is not found.
3285
       */
3286
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3287
        _Fields fields = findByThriftId(fieldId);
3288
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3289
        return fields;
3290
      }
3291
 
3292
      /**
3293
       * Find the _Fields constant that matches name, or null if its not found.
3294
       */
3295
      public static _Fields findByName(String name) {
3296
        return byName.get(name);
3297
      }
3298
 
3299
      private final short _thriftId;
3300
      private final String _fieldName;
3301
 
3302
      _Fields(short thriftId, String fieldName) {
3303
        _thriftId = thriftId;
3304
        _fieldName = fieldName;
3305
      }
3306
 
3307
      public short getThriftFieldId() {
3308
        return _thriftId;
3309
      }
3310
 
3311
      public String getFieldName() {
3312
        return _fieldName;
3313
      }
3314
    }
3315
 
3316
    // isset id assignments
3317
    private static final int __PROMOTIONID_ISSET_ID = 0;
3318
    private BitSet __isset_bit_vector = new BitSet(1);
3319
 
3430 rajveer 3320
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 3321
    static {
3430 rajveer 3322
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
3323
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3324
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
3325
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3326
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
3327
      metaDataMap = Collections.unmodifiableMap(tmpMap);
3328
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(generateCouponsForPromotion_args.class, metaDataMap);
1982 varun.gupt 3329
    }
3330
 
3331
    public generateCouponsForPromotion_args() {
3332
    }
3333
 
3334
    public generateCouponsForPromotion_args(
3335
      long promotionId,
3336
      String couponCode)
3337
    {
3338
      this();
3339
      this.promotionId = promotionId;
3340
      setPromotionIdIsSet(true);
3341
      this.couponCode = couponCode;
3342
    }
3343
 
3344
    /**
3345
     * Performs a deep copy on <i>other</i>.
3346
     */
3347
    public generateCouponsForPromotion_args(generateCouponsForPromotion_args other) {
3348
      __isset_bit_vector.clear();
3349
      __isset_bit_vector.or(other.__isset_bit_vector);
3350
      this.promotionId = other.promotionId;
3351
      if (other.isSetCouponCode()) {
3352
        this.couponCode = other.couponCode;
3353
      }
3354
    }
3355
 
3356
    public generateCouponsForPromotion_args deepCopy() {
3357
      return new generateCouponsForPromotion_args(this);
3358
    }
3359
 
3430 rajveer 3360
    @Override
3361
    public void clear() {
3362
      setPromotionIdIsSet(false);
3363
      this.promotionId = 0;
3364
      this.couponCode = null;
1982 varun.gupt 3365
    }
3366
 
3367
    public long getPromotionId() {
3368
      return this.promotionId;
3369
    }
3370
 
3430 rajveer 3371
    public void setPromotionId(long promotionId) {
1982 varun.gupt 3372
      this.promotionId = promotionId;
3373
      setPromotionIdIsSet(true);
3374
    }
3375
 
3376
    public void unsetPromotionId() {
3377
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
3378
    }
3379
 
3430 rajveer 3380
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 3381
    public boolean isSetPromotionId() {
3382
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
3383
    }
3384
 
3385
    public void setPromotionIdIsSet(boolean value) {
3386
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
3387
    }
3388
 
3389
    public String getCouponCode() {
3390
      return this.couponCode;
3391
    }
3392
 
3430 rajveer 3393
    public void setCouponCode(String couponCode) {
1982 varun.gupt 3394
      this.couponCode = couponCode;
3395
    }
3396
 
3397
    public void unsetCouponCode() {
3398
      this.couponCode = null;
3399
    }
3400
 
3430 rajveer 3401
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 3402
    public boolean isSetCouponCode() {
3403
      return this.couponCode != null;
3404
    }
3405
 
3406
    public void setCouponCodeIsSet(boolean value) {
3407
      if (!value) {
3408
        this.couponCode = null;
3409
      }
3410
    }
3411
 
3412
    public void setFieldValue(_Fields field, Object value) {
3413
      switch (field) {
3414
      case PROMOTION_ID:
3415
        if (value == null) {
3416
          unsetPromotionId();
3417
        } else {
3418
          setPromotionId((Long)value);
3419
        }
3420
        break;
3421
 
3422
      case COUPON_CODE:
3423
        if (value == null) {
3424
          unsetCouponCode();
3425
        } else {
3426
          setCouponCode((String)value);
3427
        }
3428
        break;
3429
 
3430
      }
3431
    }
3432
 
3433
    public Object getFieldValue(_Fields field) {
3434
      switch (field) {
3435
      case PROMOTION_ID:
3430 rajveer 3436
        return Long.valueOf(getPromotionId());
1982 varun.gupt 3437
 
3438
      case COUPON_CODE:
3439
        return getCouponCode();
3440
 
3441
      }
3442
      throw new IllegalStateException();
3443
    }
3444
 
3430 rajveer 3445
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
3446
    public boolean isSet(_Fields field) {
3447
      if (field == null) {
3448
        throw new IllegalArgumentException();
3449
      }
1982 varun.gupt 3450
 
3451
      switch (field) {
3452
      case PROMOTION_ID:
3453
        return isSetPromotionId();
3454
      case COUPON_CODE:
3455
        return isSetCouponCode();
3456
      }
3457
      throw new IllegalStateException();
3458
    }
3459
 
3460
    @Override
3461
    public boolean equals(Object that) {
3462
      if (that == null)
3463
        return false;
3464
      if (that instanceof generateCouponsForPromotion_args)
3465
        return this.equals((generateCouponsForPromotion_args)that);
3466
      return false;
3467
    }
3468
 
3469
    public boolean equals(generateCouponsForPromotion_args that) {
3470
      if (that == null)
3471
        return false;
3472
 
3473
      boolean this_present_promotionId = true;
3474
      boolean that_present_promotionId = true;
3475
      if (this_present_promotionId || that_present_promotionId) {
3476
        if (!(this_present_promotionId && that_present_promotionId))
3477
          return false;
3478
        if (this.promotionId != that.promotionId)
3479
          return false;
3480
      }
3481
 
3482
      boolean this_present_couponCode = true && this.isSetCouponCode();
3483
      boolean that_present_couponCode = true && that.isSetCouponCode();
3484
      if (this_present_couponCode || that_present_couponCode) {
3485
        if (!(this_present_couponCode && that_present_couponCode))
3486
          return false;
3487
        if (!this.couponCode.equals(that.couponCode))
3488
          return false;
3489
      }
3490
 
3491
      return true;
3492
    }
3493
 
3494
    @Override
3495
    public int hashCode() {
3496
      return 0;
3497
    }
3498
 
3499
    public int compareTo(generateCouponsForPromotion_args other) {
3500
      if (!getClass().equals(other.getClass())) {
3501
        return getClass().getName().compareTo(other.getClass().getName());
3502
      }
3503
 
3504
      int lastComparison = 0;
3505
      generateCouponsForPromotion_args typedOther = (generateCouponsForPromotion_args)other;
3506
 
3430 rajveer 3507
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
1982 varun.gupt 3508
      if (lastComparison != 0) {
3509
        return lastComparison;
3510
      }
3430 rajveer 3511
      if (isSetPromotionId()) {
3512
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
3513
        if (lastComparison != 0) {
3514
          return lastComparison;
3515
        }
1982 varun.gupt 3516
      }
3430 rajveer 3517
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 3518
      if (lastComparison != 0) {
3519
        return lastComparison;
3520
      }
3430 rajveer 3521
      if (isSetCouponCode()) {
3522
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
3523
        if (lastComparison != 0) {
3524
          return lastComparison;
3525
        }
1982 varun.gupt 3526
      }
3527
      return 0;
3528
    }
3529
 
3430 rajveer 3530
    public _Fields fieldForId(int fieldId) {
3531
      return _Fields.findByThriftId(fieldId);
3532
    }
3533
 
3534
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
3535
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 3536
      iprot.readStructBegin();
3537
      while (true)
3538
      {
3539
        field = iprot.readFieldBegin();
3430 rajveer 3540
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 3541
          break;
3542
        }
3430 rajveer 3543
        switch (field.id) {
3544
          case 1: // PROMOTION_ID
3545
            if (field.type == org.apache.thrift.protocol.TType.I64) {
3546
              this.promotionId = iprot.readI64();
3547
              setPromotionIdIsSet(true);
3548
            } else { 
3549
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3550
            }
3551
            break;
3552
          case 2: // COUPON_CODE
3553
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
3554
              this.couponCode = iprot.readString();
3555
            } else { 
3556
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3557
            }
3558
            break;
3559
          default:
3560
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 3561
        }
3430 rajveer 3562
        iprot.readFieldEnd();
1982 varun.gupt 3563
      }
3564
      iprot.readStructEnd();
3565
      validate();
3566
    }
3567
 
3430 rajveer 3568
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 3569
      validate();
3570
 
3571
      oprot.writeStructBegin(STRUCT_DESC);
3572
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
3573
      oprot.writeI64(this.promotionId);
3574
      oprot.writeFieldEnd();
3575
      if (this.couponCode != null) {
3576
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
3577
        oprot.writeString(this.couponCode);
3578
        oprot.writeFieldEnd();
3579
      }
3580
      oprot.writeFieldStop();
3581
      oprot.writeStructEnd();
3582
    }
3583
 
3584
    @Override
3585
    public String toString() {
3586
      StringBuilder sb = new StringBuilder("generateCouponsForPromotion_args(");
3587
      boolean first = true;
3588
 
3589
      sb.append("promotionId:");
3590
      sb.append(this.promotionId);
3591
      first = false;
3592
      if (!first) sb.append(", ");
3593
      sb.append("couponCode:");
3594
      if (this.couponCode == null) {
3595
        sb.append("null");
3596
      } else {
3597
        sb.append(this.couponCode);
3598
      }
3599
      first = false;
3600
      sb.append(")");
3601
      return sb.toString();
3602
    }
3603
 
3430 rajveer 3604
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 3605
      // check for required fields
3606
    }
3607
 
3430 rajveer 3608
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
3609
      try {
3610
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
3611
      } catch (org.apache.thrift.TException te) {
3612
        throw new java.io.IOException(te);
3613
      }
3614
    }
3615
 
3616
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
3617
      try {
3618
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
3619
        __isset_bit_vector = new BitSet(1);
3620
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
3621
      } catch (org.apache.thrift.TException te) {
3622
        throw new java.io.IOException(te);
3623
      }
3624
    }
3625
 
1982 varun.gupt 3626
  }
3627
 
3430 rajveer 3628
  public static class generateCouponsForPromotion_result implements org.apache.thrift.TBase<generateCouponsForPromotion_result, generateCouponsForPromotion_result._Fields>, java.io.Serializable, Cloneable   {
3629
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("generateCouponsForPromotion_result");
1982 varun.gupt 3630
 
3430 rajveer 3631
    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 3632
 
3430 rajveer 3633
    private PromotionException pex; // required
1982 varun.gupt 3634
 
3635
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 3636
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 3637
      PEX((short)1, "pex");
3638
 
3639
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3640
 
3641
      static {
3642
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3643
          byName.put(field.getFieldName(), field);
3644
        }
3645
      }
3646
 
3647
      /**
3648
       * Find the _Fields constant that matches fieldId, or null if its not found.
3649
       */
3650
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 3651
        switch(fieldId) {
3652
          case 1: // PEX
3653
            return PEX;
3654
          default:
3655
            return null;
3656
        }
1982 varun.gupt 3657
      }
3658
 
3659
      /**
3660
       * Find the _Fields constant that matches fieldId, throwing an exception
3661
       * if it is not found.
3662
       */
3663
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3664
        _Fields fields = findByThriftId(fieldId);
3665
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3666
        return fields;
3667
      }
3668
 
3669
      /**
3670
       * Find the _Fields constant that matches name, or null if its not found.
3671
       */
3672
      public static _Fields findByName(String name) {
3673
        return byName.get(name);
3674
      }
3675
 
3676
      private final short _thriftId;
3677
      private final String _fieldName;
3678
 
3679
      _Fields(short thriftId, String fieldName) {
3680
        _thriftId = thriftId;
3681
        _fieldName = fieldName;
3682
      }
3683
 
3684
      public short getThriftFieldId() {
3685
        return _thriftId;
3686
      }
3687
 
3688
      public String getFieldName() {
3689
        return _fieldName;
3690
      }
3691
    }
3692
 
3693
    // isset id assignments
3694
 
3430 rajveer 3695
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 3696
    static {
3430 rajveer 3697
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
3698
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3699
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
3700
      metaDataMap = Collections.unmodifiableMap(tmpMap);
3701
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(generateCouponsForPromotion_result.class, metaDataMap);
1982 varun.gupt 3702
    }
3703
 
3704
    public generateCouponsForPromotion_result() {
3705
    }
3706
 
3707
    public generateCouponsForPromotion_result(
3708
      PromotionException pex)
3709
    {
3710
      this();
3711
      this.pex = pex;
3712
    }
3713
 
3714
    /**
3715
     * Performs a deep copy on <i>other</i>.
3716
     */
3717
    public generateCouponsForPromotion_result(generateCouponsForPromotion_result other) {
3718
      if (other.isSetPex()) {
3719
        this.pex = new PromotionException(other.pex);
3720
      }
3721
    }
3722
 
3723
    public generateCouponsForPromotion_result deepCopy() {
3724
      return new generateCouponsForPromotion_result(this);
3725
    }
3726
 
3430 rajveer 3727
    @Override
3728
    public void clear() {
3729
      this.pex = null;
1982 varun.gupt 3730
    }
3731
 
3732
    public PromotionException getPex() {
3733
      return this.pex;
3734
    }
3735
 
3430 rajveer 3736
    public void setPex(PromotionException pex) {
1982 varun.gupt 3737
      this.pex = pex;
3738
    }
3739
 
3740
    public void unsetPex() {
3741
      this.pex = null;
3742
    }
3743
 
3430 rajveer 3744
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 3745
    public boolean isSetPex() {
3746
      return this.pex != null;
3747
    }
3748
 
3749
    public void setPexIsSet(boolean value) {
3750
      if (!value) {
3751
        this.pex = null;
3752
      }
3753
    }
3754
 
3755
    public void setFieldValue(_Fields field, Object value) {
3756
      switch (field) {
3757
      case PEX:
3758
        if (value == null) {
3759
          unsetPex();
3760
        } else {
3761
          setPex((PromotionException)value);
3762
        }
3763
        break;
3764
 
3765
      }
3766
    }
3767
 
3768
    public Object getFieldValue(_Fields field) {
3769
      switch (field) {
3770
      case PEX:
3771
        return getPex();
3772
 
3773
      }
3774
      throw new IllegalStateException();
3775
    }
3776
 
3430 rajveer 3777
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
3778
    public boolean isSet(_Fields field) {
3779
      if (field == null) {
3780
        throw new IllegalArgumentException();
3781
      }
1982 varun.gupt 3782
 
3783
      switch (field) {
3784
      case PEX:
3785
        return isSetPex();
3786
      }
3787
      throw new IllegalStateException();
3788
    }
3789
 
3790
    @Override
3791
    public boolean equals(Object that) {
3792
      if (that == null)
3793
        return false;
3794
      if (that instanceof generateCouponsForPromotion_result)
3795
        return this.equals((generateCouponsForPromotion_result)that);
3796
      return false;
3797
    }
3798
 
3799
    public boolean equals(generateCouponsForPromotion_result that) {
3800
      if (that == null)
3801
        return false;
3802
 
3803
      boolean this_present_pex = true && this.isSetPex();
3804
      boolean that_present_pex = true && that.isSetPex();
3805
      if (this_present_pex || that_present_pex) {
3806
        if (!(this_present_pex && that_present_pex))
3807
          return false;
3808
        if (!this.pex.equals(that.pex))
3809
          return false;
3810
      }
3811
 
3812
      return true;
3813
    }
3814
 
3815
    @Override
3816
    public int hashCode() {
3817
      return 0;
3818
    }
3819
 
3820
    public int compareTo(generateCouponsForPromotion_result other) {
3821
      if (!getClass().equals(other.getClass())) {
3822
        return getClass().getName().compareTo(other.getClass().getName());
3823
      }
3824
 
3825
      int lastComparison = 0;
3826
      generateCouponsForPromotion_result typedOther = (generateCouponsForPromotion_result)other;
3827
 
3430 rajveer 3828
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 3829
      if (lastComparison != 0) {
3830
        return lastComparison;
3831
      }
3430 rajveer 3832
      if (isSetPex()) {
3833
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
3834
        if (lastComparison != 0) {
3835
          return lastComparison;
3836
        }
1982 varun.gupt 3837
      }
3838
      return 0;
3839
    }
3840
 
3430 rajveer 3841
    public _Fields fieldForId(int fieldId) {
3842
      return _Fields.findByThriftId(fieldId);
3843
    }
3844
 
3845
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
3846
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 3847
      iprot.readStructBegin();
3848
      while (true)
3849
      {
3850
        field = iprot.readFieldBegin();
3430 rajveer 3851
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 3852
          break;
3853
        }
3430 rajveer 3854
        switch (field.id) {
3855
          case 1: // PEX
3856
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
3857
              this.pex = new PromotionException();
3858
              this.pex.read(iprot);
3859
            } else { 
3860
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3861
            }
3862
            break;
3863
          default:
3864
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 3865
        }
3430 rajveer 3866
        iprot.readFieldEnd();
1982 varun.gupt 3867
      }
3868
      iprot.readStructEnd();
3869
      validate();
3870
    }
3871
 
3430 rajveer 3872
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 3873
      oprot.writeStructBegin(STRUCT_DESC);
3874
 
3875
      if (this.isSetPex()) {
3876
        oprot.writeFieldBegin(PEX_FIELD_DESC);
3877
        this.pex.write(oprot);
3878
        oprot.writeFieldEnd();
3879
      }
3880
      oprot.writeFieldStop();
3881
      oprot.writeStructEnd();
3882
    }
3883
 
3884
    @Override
3885
    public String toString() {
3886
      StringBuilder sb = new StringBuilder("generateCouponsForPromotion_result(");
3887
      boolean first = true;
3888
 
3889
      sb.append("pex:");
3890
      if (this.pex == null) {
3891
        sb.append("null");
3892
      } else {
3893
        sb.append(this.pex);
3894
      }
3895
      first = false;
3896
      sb.append(")");
3897
      return sb.toString();
3898
    }
3899
 
3430 rajveer 3900
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 3901
      // check for required fields
3902
    }
3903
 
3430 rajveer 3904
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
3905
      try {
3906
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
3907
      } catch (org.apache.thrift.TException te) {
3908
        throw new java.io.IOException(te);
3909
      }
3910
    }
3911
 
3912
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
3913
      try {
3914
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
3915
      } catch (org.apache.thrift.TException te) {
3916
        throw new java.io.IOException(te);
3917
      }
3918
    }
3919
 
1982 varun.gupt 3920
  }
3921
 
3430 rajveer 3922
  public static class applyCoupon_args implements org.apache.thrift.TBase<applyCoupon_args, applyCoupon_args._Fields>, java.io.Serializable, Cloneable   {
3923
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyCoupon_args");
1982 varun.gupt 3924
 
3430 rajveer 3925
    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);
3926
    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 3927
 
3430 rajveer 3928
    private String couponCode; // required
3929
    private long cartId; // required
1982 varun.gupt 3930
 
3931
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 3932
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 3933
      COUPON_CODE((short)1, "couponCode"),
3934
      CART_ID((short)2, "cartId");
3935
 
3936
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3937
 
3938
      static {
3939
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3940
          byName.put(field.getFieldName(), field);
3941
        }
3942
      }
3943
 
3944
      /**
3945
       * Find the _Fields constant that matches fieldId, or null if its not found.
3946
       */
3947
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 3948
        switch(fieldId) {
3949
          case 1: // COUPON_CODE
3950
            return COUPON_CODE;
3951
          case 2: // CART_ID
3952
            return CART_ID;
3953
          default:
3954
            return null;
3955
        }
1982 varun.gupt 3956
      }
3957
 
3958
      /**
3959
       * Find the _Fields constant that matches fieldId, throwing an exception
3960
       * if it is not found.
3961
       */
3962
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3963
        _Fields fields = findByThriftId(fieldId);
3964
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3965
        return fields;
3966
      }
3967
 
3968
      /**
3969
       * Find the _Fields constant that matches name, or null if its not found.
3970
       */
3971
      public static _Fields findByName(String name) {
3972
        return byName.get(name);
3973
      }
3974
 
3975
      private final short _thriftId;
3976
      private final String _fieldName;
3977
 
3978
      _Fields(short thriftId, String fieldName) {
3979
        _thriftId = thriftId;
3980
        _fieldName = fieldName;
3981
      }
3982
 
3983
      public short getThriftFieldId() {
3984
        return _thriftId;
3985
      }
3986
 
3987
      public String getFieldName() {
3988
        return _fieldName;
3989
      }
3990
    }
3991
 
3992
    // isset id assignments
3993
    private static final int __CARTID_ISSET_ID = 0;
3994
    private BitSet __isset_bit_vector = new BitSet(1);
3995
 
3430 rajveer 3996
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 3997
    static {
3430 rajveer 3998
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
3999
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4000
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
4001
      tmpMap.put(_Fields.CART_ID, new org.apache.thrift.meta_data.FieldMetaData("cartId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4002
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
4003
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4004
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyCoupon_args.class, metaDataMap);
1982 varun.gupt 4005
    }
4006
 
4007
    public applyCoupon_args() {
4008
    }
4009
 
4010
    public applyCoupon_args(
4011
      String couponCode,
4012
      long cartId)
4013
    {
4014
      this();
4015
      this.couponCode = couponCode;
4016
      this.cartId = cartId;
4017
      setCartIdIsSet(true);
4018
    }
4019
 
4020
    /**
4021
     * Performs a deep copy on <i>other</i>.
4022
     */
4023
    public applyCoupon_args(applyCoupon_args other) {
4024
      __isset_bit_vector.clear();
4025
      __isset_bit_vector.or(other.__isset_bit_vector);
4026
      if (other.isSetCouponCode()) {
4027
        this.couponCode = other.couponCode;
4028
      }
4029
      this.cartId = other.cartId;
4030
    }
4031
 
4032
    public applyCoupon_args deepCopy() {
4033
      return new applyCoupon_args(this);
4034
    }
4035
 
3430 rajveer 4036
    @Override
4037
    public void clear() {
4038
      this.couponCode = null;
4039
      setCartIdIsSet(false);
4040
      this.cartId = 0;
1982 varun.gupt 4041
    }
4042
 
4043
    public String getCouponCode() {
4044
      return this.couponCode;
4045
    }
4046
 
3430 rajveer 4047
    public void setCouponCode(String couponCode) {
1982 varun.gupt 4048
      this.couponCode = couponCode;
4049
    }
4050
 
4051
    public void unsetCouponCode() {
4052
      this.couponCode = null;
4053
    }
4054
 
3430 rajveer 4055
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 4056
    public boolean isSetCouponCode() {
4057
      return this.couponCode != null;
4058
    }
4059
 
4060
    public void setCouponCodeIsSet(boolean value) {
4061
      if (!value) {
4062
        this.couponCode = null;
4063
      }
4064
    }
4065
 
4066
    public long getCartId() {
4067
      return this.cartId;
4068
    }
4069
 
3430 rajveer 4070
    public void setCartId(long cartId) {
1982 varun.gupt 4071
      this.cartId = cartId;
4072
      setCartIdIsSet(true);
4073
    }
4074
 
4075
    public void unsetCartId() {
4076
      __isset_bit_vector.clear(__CARTID_ISSET_ID);
4077
    }
4078
 
3430 rajveer 4079
    /** Returns true if field cartId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 4080
    public boolean isSetCartId() {
4081
      return __isset_bit_vector.get(__CARTID_ISSET_ID);
4082
    }
4083
 
4084
    public void setCartIdIsSet(boolean value) {
4085
      __isset_bit_vector.set(__CARTID_ISSET_ID, value);
4086
    }
4087
 
4088
    public void setFieldValue(_Fields field, Object value) {
4089
      switch (field) {
4090
      case COUPON_CODE:
4091
        if (value == null) {
4092
          unsetCouponCode();
4093
        } else {
4094
          setCouponCode((String)value);
4095
        }
4096
        break;
4097
 
4098
      case CART_ID:
4099
        if (value == null) {
4100
          unsetCartId();
4101
        } else {
4102
          setCartId((Long)value);
4103
        }
4104
        break;
4105
 
4106
      }
4107
    }
4108
 
4109
    public Object getFieldValue(_Fields field) {
4110
      switch (field) {
4111
      case COUPON_CODE:
4112
        return getCouponCode();
4113
 
4114
      case CART_ID:
3430 rajveer 4115
        return Long.valueOf(getCartId());
1982 varun.gupt 4116
 
4117
      }
4118
      throw new IllegalStateException();
4119
    }
4120
 
3430 rajveer 4121
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
4122
    public boolean isSet(_Fields field) {
4123
      if (field == null) {
4124
        throw new IllegalArgumentException();
4125
      }
1982 varun.gupt 4126
 
4127
      switch (field) {
4128
      case COUPON_CODE:
4129
        return isSetCouponCode();
4130
      case CART_ID:
4131
        return isSetCartId();
4132
      }
4133
      throw new IllegalStateException();
4134
    }
4135
 
4136
    @Override
4137
    public boolean equals(Object that) {
4138
      if (that == null)
4139
        return false;
4140
      if (that instanceof applyCoupon_args)
4141
        return this.equals((applyCoupon_args)that);
4142
      return false;
4143
    }
4144
 
4145
    public boolean equals(applyCoupon_args that) {
4146
      if (that == null)
4147
        return false;
4148
 
4149
      boolean this_present_couponCode = true && this.isSetCouponCode();
4150
      boolean that_present_couponCode = true && that.isSetCouponCode();
4151
      if (this_present_couponCode || that_present_couponCode) {
4152
        if (!(this_present_couponCode && that_present_couponCode))
4153
          return false;
4154
        if (!this.couponCode.equals(that.couponCode))
4155
          return false;
4156
      }
4157
 
4158
      boolean this_present_cartId = true;
4159
      boolean that_present_cartId = true;
4160
      if (this_present_cartId || that_present_cartId) {
4161
        if (!(this_present_cartId && that_present_cartId))
4162
          return false;
4163
        if (this.cartId != that.cartId)
4164
          return false;
4165
      }
4166
 
4167
      return true;
4168
    }
4169
 
4170
    @Override
4171
    public int hashCode() {
4172
      return 0;
4173
    }
4174
 
4175
    public int compareTo(applyCoupon_args other) {
4176
      if (!getClass().equals(other.getClass())) {
4177
        return getClass().getName().compareTo(other.getClass().getName());
4178
      }
4179
 
4180
      int lastComparison = 0;
4181
      applyCoupon_args typedOther = (applyCoupon_args)other;
4182
 
3430 rajveer 4183
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 4184
      if (lastComparison != 0) {
4185
        return lastComparison;
4186
      }
3430 rajveer 4187
      if (isSetCouponCode()) {
4188
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
4189
        if (lastComparison != 0) {
4190
          return lastComparison;
4191
        }
1982 varun.gupt 4192
      }
3430 rajveer 4193
      lastComparison = Boolean.valueOf(isSetCartId()).compareTo(typedOther.isSetCartId());
1982 varun.gupt 4194
      if (lastComparison != 0) {
4195
        return lastComparison;
4196
      }
3430 rajveer 4197
      if (isSetCartId()) {
4198
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cartId, typedOther.cartId);
4199
        if (lastComparison != 0) {
4200
          return lastComparison;
4201
        }
1982 varun.gupt 4202
      }
4203
      return 0;
4204
    }
4205
 
3430 rajveer 4206
    public _Fields fieldForId(int fieldId) {
4207
      return _Fields.findByThriftId(fieldId);
4208
    }
4209
 
4210
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4211
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 4212
      iprot.readStructBegin();
4213
      while (true)
4214
      {
4215
        field = iprot.readFieldBegin();
3430 rajveer 4216
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 4217
          break;
4218
        }
3430 rajveer 4219
        switch (field.id) {
4220
          case 1: // COUPON_CODE
4221
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
4222
              this.couponCode = iprot.readString();
4223
            } else { 
4224
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4225
            }
4226
            break;
4227
          case 2: // CART_ID
4228
            if (field.type == org.apache.thrift.protocol.TType.I64) {
4229
              this.cartId = iprot.readI64();
4230
              setCartIdIsSet(true);
4231
            } else { 
4232
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4233
            }
4234
            break;
4235
          default:
4236
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 4237
        }
3430 rajveer 4238
        iprot.readFieldEnd();
1982 varun.gupt 4239
      }
4240
      iprot.readStructEnd();
4241
      validate();
4242
    }
4243
 
3430 rajveer 4244
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 4245
      validate();
4246
 
4247
      oprot.writeStructBegin(STRUCT_DESC);
4248
      if (this.couponCode != null) {
4249
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
4250
        oprot.writeString(this.couponCode);
4251
        oprot.writeFieldEnd();
4252
      }
4253
      oprot.writeFieldBegin(CART_ID_FIELD_DESC);
4254
      oprot.writeI64(this.cartId);
4255
      oprot.writeFieldEnd();
4256
      oprot.writeFieldStop();
4257
      oprot.writeStructEnd();
4258
    }
4259
 
4260
    @Override
4261
    public String toString() {
4262
      StringBuilder sb = new StringBuilder("applyCoupon_args(");
4263
      boolean first = true;
4264
 
4265
      sb.append("couponCode:");
4266
      if (this.couponCode == null) {
4267
        sb.append("null");
4268
      } else {
4269
        sb.append(this.couponCode);
4270
      }
4271
      first = false;
4272
      if (!first) sb.append(", ");
4273
      sb.append("cartId:");
4274
      sb.append(this.cartId);
4275
      first = false;
4276
      sb.append(")");
4277
      return sb.toString();
4278
    }
4279
 
3430 rajveer 4280
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 4281
      // check for required fields
4282
    }
4283
 
3430 rajveer 4284
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
4285
      try {
4286
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
4287
      } catch (org.apache.thrift.TException te) {
4288
        throw new java.io.IOException(te);
4289
      }
4290
    }
4291
 
4292
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
4293
      try {
4294
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
4295
        __isset_bit_vector = new BitSet(1);
4296
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
4297
      } catch (org.apache.thrift.TException te) {
4298
        throw new java.io.IOException(te);
4299
      }
4300
    }
4301
 
1982 varun.gupt 4302
  }
4303
 
3430 rajveer 4304
  public static class applyCoupon_result implements org.apache.thrift.TBase<applyCoupon_result, applyCoupon_result._Fields>, java.io.Serializable, Cloneable   {
4305
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyCoupon_result");
1982 varun.gupt 4306
 
3430 rajveer 4307
    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);
4308
    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 4309
 
3430 rajveer 4310
    private Cart success; // required
4311
    private PromotionException pex; // required
1982 varun.gupt 4312
 
4313
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 4314
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 4315
      SUCCESS((short)0, "success"),
4316
      PEX((short)1, "pex");
4317
 
4318
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4319
 
4320
      static {
4321
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4322
          byName.put(field.getFieldName(), field);
4323
        }
4324
      }
4325
 
4326
      /**
4327
       * Find the _Fields constant that matches fieldId, or null if its not found.
4328
       */
4329
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 4330
        switch(fieldId) {
4331
          case 0: // SUCCESS
4332
            return SUCCESS;
4333
          case 1: // PEX
4334
            return PEX;
4335
          default:
4336
            return null;
4337
        }
1982 varun.gupt 4338
      }
4339
 
4340
      /**
4341
       * Find the _Fields constant that matches fieldId, throwing an exception
4342
       * if it is not found.
4343
       */
4344
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4345
        _Fields fields = findByThriftId(fieldId);
4346
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4347
        return fields;
4348
      }
4349
 
4350
      /**
4351
       * Find the _Fields constant that matches name, or null if its not found.
4352
       */
4353
      public static _Fields findByName(String name) {
4354
        return byName.get(name);
4355
      }
4356
 
4357
      private final short _thriftId;
4358
      private final String _fieldName;
4359
 
4360
      _Fields(short thriftId, String fieldName) {
4361
        _thriftId = thriftId;
4362
        _fieldName = fieldName;
4363
      }
4364
 
4365
      public short getThriftFieldId() {
4366
        return _thriftId;
4367
      }
4368
 
4369
      public String getFieldName() {
4370
        return _fieldName;
4371
      }
4372
    }
4373
 
4374
    // isset id assignments
4375
 
3430 rajveer 4376
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 4377
    static {
3430 rajveer 4378
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
4379
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4380
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Cart.class)));
4381
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4382
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
4383
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4384
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyCoupon_result.class, metaDataMap);
1982 varun.gupt 4385
    }
4386
 
4387
    public applyCoupon_result() {
4388
    }
4389
 
4390
    public applyCoupon_result(
4391
      Cart success,
4392
      PromotionException pex)
4393
    {
4394
      this();
4395
      this.success = success;
4396
      this.pex = pex;
4397
    }
4398
 
4399
    /**
4400
     * Performs a deep copy on <i>other</i>.
4401
     */
4402
    public applyCoupon_result(applyCoupon_result other) {
4403
      if (other.isSetSuccess()) {
4404
        this.success = new Cart(other.success);
4405
      }
4406
      if (other.isSetPex()) {
4407
        this.pex = new PromotionException(other.pex);
4408
      }
4409
    }
4410
 
4411
    public applyCoupon_result deepCopy() {
4412
      return new applyCoupon_result(this);
4413
    }
4414
 
3430 rajveer 4415
    @Override
4416
    public void clear() {
4417
      this.success = null;
4418
      this.pex = null;
1982 varun.gupt 4419
    }
4420
 
4421
    public Cart getSuccess() {
4422
      return this.success;
4423
    }
4424
 
3430 rajveer 4425
    public void setSuccess(Cart success) {
1982 varun.gupt 4426
      this.success = success;
4427
    }
4428
 
4429
    public void unsetSuccess() {
4430
      this.success = null;
4431
    }
4432
 
3430 rajveer 4433
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 4434
    public boolean isSetSuccess() {
4435
      return this.success != null;
4436
    }
4437
 
4438
    public void setSuccessIsSet(boolean value) {
4439
      if (!value) {
4440
        this.success = null;
4441
      }
4442
    }
4443
 
4444
    public PromotionException getPex() {
4445
      return this.pex;
4446
    }
4447
 
3430 rajveer 4448
    public void setPex(PromotionException pex) {
1982 varun.gupt 4449
      this.pex = pex;
4450
    }
4451
 
4452
    public void unsetPex() {
4453
      this.pex = null;
4454
    }
4455
 
3430 rajveer 4456
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 4457
    public boolean isSetPex() {
4458
      return this.pex != null;
4459
    }
4460
 
4461
    public void setPexIsSet(boolean value) {
4462
      if (!value) {
4463
        this.pex = null;
4464
      }
4465
    }
4466
 
4467
    public void setFieldValue(_Fields field, Object value) {
4468
      switch (field) {
4469
      case SUCCESS:
4470
        if (value == null) {
4471
          unsetSuccess();
4472
        } else {
4473
          setSuccess((Cart)value);
4474
        }
4475
        break;
4476
 
4477
      case PEX:
4478
        if (value == null) {
4479
          unsetPex();
4480
        } else {
4481
          setPex((PromotionException)value);
4482
        }
4483
        break;
4484
 
4485
      }
4486
    }
4487
 
4488
    public Object getFieldValue(_Fields field) {
4489
      switch (field) {
4490
      case SUCCESS:
4491
        return getSuccess();
4492
 
4493
      case PEX:
4494
        return getPex();
4495
 
4496
      }
4497
      throw new IllegalStateException();
4498
    }
4499
 
3430 rajveer 4500
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
4501
    public boolean isSet(_Fields field) {
4502
      if (field == null) {
4503
        throw new IllegalArgumentException();
4504
      }
1982 varun.gupt 4505
 
4506
      switch (field) {
4507
      case SUCCESS:
4508
        return isSetSuccess();
4509
      case PEX:
4510
        return isSetPex();
4511
      }
4512
      throw new IllegalStateException();
4513
    }
4514
 
4515
    @Override
4516
    public boolean equals(Object that) {
4517
      if (that == null)
4518
        return false;
4519
      if (that instanceof applyCoupon_result)
4520
        return this.equals((applyCoupon_result)that);
4521
      return false;
4522
    }
4523
 
4524
    public boolean equals(applyCoupon_result that) {
4525
      if (that == null)
4526
        return false;
4527
 
4528
      boolean this_present_success = true && this.isSetSuccess();
4529
      boolean that_present_success = true && that.isSetSuccess();
4530
      if (this_present_success || that_present_success) {
4531
        if (!(this_present_success && that_present_success))
4532
          return false;
4533
        if (!this.success.equals(that.success))
4534
          return false;
4535
      }
4536
 
4537
      boolean this_present_pex = true && this.isSetPex();
4538
      boolean that_present_pex = true && that.isSetPex();
4539
      if (this_present_pex || that_present_pex) {
4540
        if (!(this_present_pex && that_present_pex))
4541
          return false;
4542
        if (!this.pex.equals(that.pex))
4543
          return false;
4544
      }
4545
 
4546
      return true;
4547
    }
4548
 
4549
    @Override
4550
    public int hashCode() {
4551
      return 0;
4552
    }
4553
 
4554
    public int compareTo(applyCoupon_result other) {
4555
      if (!getClass().equals(other.getClass())) {
4556
        return getClass().getName().compareTo(other.getClass().getName());
4557
      }
4558
 
4559
      int lastComparison = 0;
4560
      applyCoupon_result typedOther = (applyCoupon_result)other;
4561
 
3430 rajveer 4562
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 4563
      if (lastComparison != 0) {
4564
        return lastComparison;
4565
      }
3430 rajveer 4566
      if (isSetSuccess()) {
4567
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
4568
        if (lastComparison != 0) {
4569
          return lastComparison;
4570
        }
1982 varun.gupt 4571
      }
3430 rajveer 4572
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 4573
      if (lastComparison != 0) {
4574
        return lastComparison;
4575
      }
3430 rajveer 4576
      if (isSetPex()) {
4577
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
4578
        if (lastComparison != 0) {
4579
          return lastComparison;
4580
        }
1982 varun.gupt 4581
      }
4582
      return 0;
4583
    }
4584
 
3430 rajveer 4585
    public _Fields fieldForId(int fieldId) {
4586
      return _Fields.findByThriftId(fieldId);
4587
    }
4588
 
4589
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4590
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 4591
      iprot.readStructBegin();
4592
      while (true)
4593
      {
4594
        field = iprot.readFieldBegin();
3430 rajveer 4595
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 4596
          break;
4597
        }
3430 rajveer 4598
        switch (field.id) {
4599
          case 0: // SUCCESS
4600
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
4601
              this.success = new Cart();
4602
              this.success.read(iprot);
4603
            } else { 
4604
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4605
            }
4606
            break;
4607
          case 1: // PEX
4608
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
4609
              this.pex = new PromotionException();
4610
              this.pex.read(iprot);
4611
            } else { 
4612
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4613
            }
4614
            break;
4615
          default:
4616
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 4617
        }
3430 rajveer 4618
        iprot.readFieldEnd();
1982 varun.gupt 4619
      }
4620
      iprot.readStructEnd();
4621
      validate();
4622
    }
4623
 
3430 rajveer 4624
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 4625
      oprot.writeStructBegin(STRUCT_DESC);
4626
 
4627
      if (this.isSetSuccess()) {
4628
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
4629
        this.success.write(oprot);
4630
        oprot.writeFieldEnd();
4631
      } else if (this.isSetPex()) {
4632
        oprot.writeFieldBegin(PEX_FIELD_DESC);
4633
        this.pex.write(oprot);
4634
        oprot.writeFieldEnd();
4635
      }
4636
      oprot.writeFieldStop();
4637
      oprot.writeStructEnd();
4638
    }
4639
 
4640
    @Override
4641
    public String toString() {
4642
      StringBuilder sb = new StringBuilder("applyCoupon_result(");
4643
      boolean first = true;
4644
 
4645
      sb.append("success:");
4646
      if (this.success == null) {
4647
        sb.append("null");
4648
      } else {
4649
        sb.append(this.success);
4650
      }
4651
      first = false;
4652
      if (!first) sb.append(", ");
4653
      sb.append("pex:");
4654
      if (this.pex == null) {
4655
        sb.append("null");
4656
      } else {
4657
        sb.append(this.pex);
4658
      }
4659
      first = false;
4660
      sb.append(")");
4661
      return sb.toString();
4662
    }
4663
 
3430 rajveer 4664
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 4665
      // check for required fields
4666
    }
4667
 
3430 rajveer 4668
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
4669
      try {
4670
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
4671
      } catch (org.apache.thrift.TException te) {
4672
        throw new java.io.IOException(te);
4673
      }
4674
    }
4675
 
4676
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
4677
      try {
4678
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
4679
      } catch (org.apache.thrift.TException te) {
4680
        throw new java.io.IOException(te);
4681
      }
4682
    }
4683
 
1982 varun.gupt 4684
  }
4685
 
3430 rajveer 4686
  public static class trackCouponUsage_args implements org.apache.thrift.TBase<trackCouponUsage_args, trackCouponUsage_args._Fields>, java.io.Serializable, Cloneable   {
4687
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("trackCouponUsage_args");
1982 varun.gupt 4688
 
3430 rajveer 4689
    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);
4690
    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);
4691
    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 4692
 
3430 rajveer 4693
    private String couponCode; // required
4694
    private long transactionId; // required
4695
    private long userId; // required
1982 varun.gupt 4696
 
4697
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 4698
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 4699
      COUPON_CODE((short)1, "couponCode"),
4700
      TRANSACTION_ID((short)2, "transactionId"),
4701
      USER_ID((short)3, "userId");
4702
 
4703
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4704
 
4705
      static {
4706
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4707
          byName.put(field.getFieldName(), field);
4708
        }
4709
      }
4710
 
4711
      /**
4712
       * Find the _Fields constant that matches fieldId, or null if its not found.
4713
       */
4714
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 4715
        switch(fieldId) {
4716
          case 1: // COUPON_CODE
4717
            return COUPON_CODE;
4718
          case 2: // TRANSACTION_ID
4719
            return TRANSACTION_ID;
4720
          case 3: // USER_ID
4721
            return USER_ID;
4722
          default:
4723
            return null;
4724
        }
1982 varun.gupt 4725
      }
4726
 
4727
      /**
4728
       * Find the _Fields constant that matches fieldId, throwing an exception
4729
       * if it is not found.
4730
       */
4731
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4732
        _Fields fields = findByThriftId(fieldId);
4733
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4734
        return fields;
4735
      }
4736
 
4737
      /**
4738
       * Find the _Fields constant that matches name, or null if its not found.
4739
       */
4740
      public static _Fields findByName(String name) {
4741
        return byName.get(name);
4742
      }
4743
 
4744
      private final short _thriftId;
4745
      private final String _fieldName;
4746
 
4747
      _Fields(short thriftId, String fieldName) {
4748
        _thriftId = thriftId;
4749
        _fieldName = fieldName;
4750
      }
4751
 
4752
      public short getThriftFieldId() {
4753
        return _thriftId;
4754
      }
4755
 
4756
      public String getFieldName() {
4757
        return _fieldName;
4758
      }
4759
    }
4760
 
4761
    // isset id assignments
4762
    private static final int __TRANSACTIONID_ISSET_ID = 0;
4763
    private static final int __USERID_ISSET_ID = 1;
4764
    private BitSet __isset_bit_vector = new BitSet(2);
4765
 
3430 rajveer 4766
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 4767
    static {
3430 rajveer 4768
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
4769
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4770
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
4771
      tmpMap.put(_Fields.TRANSACTION_ID, new org.apache.thrift.meta_data.FieldMetaData("transactionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4772
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
4773
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4774
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
4775
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4776
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(trackCouponUsage_args.class, metaDataMap);
1982 varun.gupt 4777
    }
4778
 
4779
    public trackCouponUsage_args() {
4780
    }
4781
 
4782
    public trackCouponUsage_args(
4783
      String couponCode,
4784
      long transactionId,
4785
      long userId)
4786
    {
4787
      this();
4788
      this.couponCode = couponCode;
4789
      this.transactionId = transactionId;
4790
      setTransactionIdIsSet(true);
4791
      this.userId = userId;
4792
      setUserIdIsSet(true);
4793
    }
4794
 
4795
    /**
4796
     * Performs a deep copy on <i>other</i>.
4797
     */
4798
    public trackCouponUsage_args(trackCouponUsage_args other) {
4799
      __isset_bit_vector.clear();
4800
      __isset_bit_vector.or(other.__isset_bit_vector);
4801
      if (other.isSetCouponCode()) {
4802
        this.couponCode = other.couponCode;
4803
      }
4804
      this.transactionId = other.transactionId;
4805
      this.userId = other.userId;
4806
    }
4807
 
4808
    public trackCouponUsage_args deepCopy() {
4809
      return new trackCouponUsage_args(this);
4810
    }
4811
 
3430 rajveer 4812
    @Override
4813
    public void clear() {
4814
      this.couponCode = null;
4815
      setTransactionIdIsSet(false);
4816
      this.transactionId = 0;
4817
      setUserIdIsSet(false);
4818
      this.userId = 0;
1982 varun.gupt 4819
    }
4820
 
4821
    public String getCouponCode() {
4822
      return this.couponCode;
4823
    }
4824
 
3430 rajveer 4825
    public void setCouponCode(String couponCode) {
1982 varun.gupt 4826
      this.couponCode = couponCode;
4827
    }
4828
 
4829
    public void unsetCouponCode() {
4830
      this.couponCode = null;
4831
    }
4832
 
3430 rajveer 4833
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 4834
    public boolean isSetCouponCode() {
4835
      return this.couponCode != null;
4836
    }
4837
 
4838
    public void setCouponCodeIsSet(boolean value) {
4839
      if (!value) {
4840
        this.couponCode = null;
4841
      }
4842
    }
4843
 
4844
    public long getTransactionId() {
4845
      return this.transactionId;
4846
    }
4847
 
3430 rajveer 4848
    public void setTransactionId(long transactionId) {
1982 varun.gupt 4849
      this.transactionId = transactionId;
4850
      setTransactionIdIsSet(true);
4851
    }
4852
 
4853
    public void unsetTransactionId() {
4854
      __isset_bit_vector.clear(__TRANSACTIONID_ISSET_ID);
4855
    }
4856
 
3430 rajveer 4857
    /** Returns true if field transactionId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 4858
    public boolean isSetTransactionId() {
4859
      return __isset_bit_vector.get(__TRANSACTIONID_ISSET_ID);
4860
    }
4861
 
4862
    public void setTransactionIdIsSet(boolean value) {
4863
      __isset_bit_vector.set(__TRANSACTIONID_ISSET_ID, value);
4864
    }
4865
 
4866
    public long getUserId() {
4867
      return this.userId;
4868
    }
4869
 
3430 rajveer 4870
    public void setUserId(long userId) {
1982 varun.gupt 4871
      this.userId = userId;
4872
      setUserIdIsSet(true);
4873
    }
4874
 
4875
    public void unsetUserId() {
4876
      __isset_bit_vector.clear(__USERID_ISSET_ID);
4877
    }
4878
 
3430 rajveer 4879
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 4880
    public boolean isSetUserId() {
4881
      return __isset_bit_vector.get(__USERID_ISSET_ID);
4882
    }
4883
 
4884
    public void setUserIdIsSet(boolean value) {
4885
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
4886
    }
4887
 
4888
    public void setFieldValue(_Fields field, Object value) {
4889
      switch (field) {
4890
      case COUPON_CODE:
4891
        if (value == null) {
4892
          unsetCouponCode();
4893
        } else {
4894
          setCouponCode((String)value);
4895
        }
4896
        break;
4897
 
4898
      case TRANSACTION_ID:
4899
        if (value == null) {
4900
          unsetTransactionId();
4901
        } else {
4902
          setTransactionId((Long)value);
4903
        }
4904
        break;
4905
 
4906
      case USER_ID:
4907
        if (value == null) {
4908
          unsetUserId();
4909
        } else {
4910
          setUserId((Long)value);
4911
        }
4912
        break;
4913
 
4914
      }
4915
    }
4916
 
4917
    public Object getFieldValue(_Fields field) {
4918
      switch (field) {
4919
      case COUPON_CODE:
4920
        return getCouponCode();
4921
 
4922
      case TRANSACTION_ID:
3430 rajveer 4923
        return Long.valueOf(getTransactionId());
1982 varun.gupt 4924
 
4925
      case USER_ID:
3430 rajveer 4926
        return Long.valueOf(getUserId());
1982 varun.gupt 4927
 
4928
      }
4929
      throw new IllegalStateException();
4930
    }
4931
 
3430 rajveer 4932
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
4933
    public boolean isSet(_Fields field) {
4934
      if (field == null) {
4935
        throw new IllegalArgumentException();
4936
      }
1982 varun.gupt 4937
 
4938
      switch (field) {
4939
      case COUPON_CODE:
4940
        return isSetCouponCode();
4941
      case TRANSACTION_ID:
4942
        return isSetTransactionId();
4943
      case USER_ID:
4944
        return isSetUserId();
4945
      }
4946
      throw new IllegalStateException();
4947
    }
4948
 
4949
    @Override
4950
    public boolean equals(Object that) {
4951
      if (that == null)
4952
        return false;
4953
      if (that instanceof trackCouponUsage_args)
4954
        return this.equals((trackCouponUsage_args)that);
4955
      return false;
4956
    }
4957
 
4958
    public boolean equals(trackCouponUsage_args that) {
4959
      if (that == null)
4960
        return false;
4961
 
4962
      boolean this_present_couponCode = true && this.isSetCouponCode();
4963
      boolean that_present_couponCode = true && that.isSetCouponCode();
4964
      if (this_present_couponCode || that_present_couponCode) {
4965
        if (!(this_present_couponCode && that_present_couponCode))
4966
          return false;
4967
        if (!this.couponCode.equals(that.couponCode))
4968
          return false;
4969
      }
4970
 
4971
      boolean this_present_transactionId = true;
4972
      boolean that_present_transactionId = true;
4973
      if (this_present_transactionId || that_present_transactionId) {
4974
        if (!(this_present_transactionId && that_present_transactionId))
4975
          return false;
4976
        if (this.transactionId != that.transactionId)
4977
          return false;
4978
      }
4979
 
4980
      boolean this_present_userId = true;
4981
      boolean that_present_userId = true;
4982
      if (this_present_userId || that_present_userId) {
4983
        if (!(this_present_userId && that_present_userId))
4984
          return false;
4985
        if (this.userId != that.userId)
4986
          return false;
4987
      }
4988
 
4989
      return true;
4990
    }
4991
 
4992
    @Override
4993
    public int hashCode() {
4994
      return 0;
4995
    }
4996
 
4997
    public int compareTo(trackCouponUsage_args other) {
4998
      if (!getClass().equals(other.getClass())) {
4999
        return getClass().getName().compareTo(other.getClass().getName());
5000
      }
5001
 
5002
      int lastComparison = 0;
5003
      trackCouponUsage_args typedOther = (trackCouponUsage_args)other;
5004
 
3430 rajveer 5005
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 5006
      if (lastComparison != 0) {
5007
        return lastComparison;
5008
      }
3430 rajveer 5009
      if (isSetCouponCode()) {
5010
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
5011
        if (lastComparison != 0) {
5012
          return lastComparison;
5013
        }
1982 varun.gupt 5014
      }
3430 rajveer 5015
      lastComparison = Boolean.valueOf(isSetTransactionId()).compareTo(typedOther.isSetTransactionId());
1982 varun.gupt 5016
      if (lastComparison != 0) {
5017
        return lastComparison;
5018
      }
3430 rajveer 5019
      if (isSetTransactionId()) {
5020
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.transactionId, typedOther.transactionId);
5021
        if (lastComparison != 0) {
5022
          return lastComparison;
5023
        }
1982 varun.gupt 5024
      }
3430 rajveer 5025
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
1982 varun.gupt 5026
      if (lastComparison != 0) {
5027
        return lastComparison;
5028
      }
3430 rajveer 5029
      if (isSetUserId()) {
5030
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
5031
        if (lastComparison != 0) {
5032
          return lastComparison;
5033
        }
1982 varun.gupt 5034
      }
5035
      return 0;
5036
    }
5037
 
3430 rajveer 5038
    public _Fields fieldForId(int fieldId) {
5039
      return _Fields.findByThriftId(fieldId);
5040
    }
5041
 
5042
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
5043
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 5044
      iprot.readStructBegin();
5045
      while (true)
5046
      {
5047
        field = iprot.readFieldBegin();
3430 rajveer 5048
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 5049
          break;
5050
        }
3430 rajveer 5051
        switch (field.id) {
5052
          case 1: // COUPON_CODE
5053
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
5054
              this.couponCode = iprot.readString();
5055
            } else { 
5056
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5057
            }
5058
            break;
5059
          case 2: // TRANSACTION_ID
5060
            if (field.type == org.apache.thrift.protocol.TType.I64) {
5061
              this.transactionId = iprot.readI64();
5062
              setTransactionIdIsSet(true);
5063
            } else { 
5064
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5065
            }
5066
            break;
5067
          case 3: // USER_ID
5068
            if (field.type == org.apache.thrift.protocol.TType.I64) {
5069
              this.userId = iprot.readI64();
5070
              setUserIdIsSet(true);
5071
            } else { 
5072
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5073
            }
5074
            break;
5075
          default:
5076
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 5077
        }
3430 rajveer 5078
        iprot.readFieldEnd();
1982 varun.gupt 5079
      }
5080
      iprot.readStructEnd();
5081
      validate();
5082
    }
5083
 
3430 rajveer 5084
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 5085
      validate();
5086
 
5087
      oprot.writeStructBegin(STRUCT_DESC);
5088
      if (this.couponCode != null) {
5089
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
5090
        oprot.writeString(this.couponCode);
5091
        oprot.writeFieldEnd();
5092
      }
5093
      oprot.writeFieldBegin(TRANSACTION_ID_FIELD_DESC);
5094
      oprot.writeI64(this.transactionId);
5095
      oprot.writeFieldEnd();
5096
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
5097
      oprot.writeI64(this.userId);
5098
      oprot.writeFieldEnd();
5099
      oprot.writeFieldStop();
5100
      oprot.writeStructEnd();
5101
    }
5102
 
5103
    @Override
5104
    public String toString() {
5105
      StringBuilder sb = new StringBuilder("trackCouponUsage_args(");
5106
      boolean first = true;
5107
 
5108
      sb.append("couponCode:");
5109
      if (this.couponCode == null) {
5110
        sb.append("null");
5111
      } else {
5112
        sb.append(this.couponCode);
5113
      }
5114
      first = false;
5115
      if (!first) sb.append(", ");
5116
      sb.append("transactionId:");
5117
      sb.append(this.transactionId);
5118
      first = false;
5119
      if (!first) sb.append(", ");
5120
      sb.append("userId:");
5121
      sb.append(this.userId);
5122
      first = false;
5123
      sb.append(")");
5124
      return sb.toString();
5125
    }
5126
 
3430 rajveer 5127
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 5128
      // check for required fields
5129
    }
5130
 
3430 rajveer 5131
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5132
      try {
5133
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5134
      } catch (org.apache.thrift.TException te) {
5135
        throw new java.io.IOException(te);
5136
      }
5137
    }
5138
 
5139
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5140
      try {
5141
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
5142
        __isset_bit_vector = new BitSet(1);
5143
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5144
      } catch (org.apache.thrift.TException te) {
5145
        throw new java.io.IOException(te);
5146
      }
5147
    }
5148
 
1982 varun.gupt 5149
  }
5150
 
3430 rajveer 5151
  public static class trackCouponUsage_result implements org.apache.thrift.TBase<trackCouponUsage_result, trackCouponUsage_result._Fields>, java.io.Serializable, Cloneable   {
5152
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("trackCouponUsage_result");
1982 varun.gupt 5153
 
3430 rajveer 5154
    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 5155
 
3430 rajveer 5156
    private PromotionException pex; // required
1982 varun.gupt 5157
 
5158
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 5159
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 5160
      PEX((short)1, "pex");
5161
 
5162
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5163
 
5164
      static {
5165
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5166
          byName.put(field.getFieldName(), field);
5167
        }
5168
      }
5169
 
5170
      /**
5171
       * Find the _Fields constant that matches fieldId, or null if its not found.
5172
       */
5173
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 5174
        switch(fieldId) {
5175
          case 1: // PEX
5176
            return PEX;
5177
          default:
5178
            return null;
5179
        }
1982 varun.gupt 5180
      }
5181
 
5182
      /**
5183
       * Find the _Fields constant that matches fieldId, throwing an exception
5184
       * if it is not found.
5185
       */
5186
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5187
        _Fields fields = findByThriftId(fieldId);
5188
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5189
        return fields;
5190
      }
5191
 
5192
      /**
5193
       * Find the _Fields constant that matches name, or null if its not found.
5194
       */
5195
      public static _Fields findByName(String name) {
5196
        return byName.get(name);
5197
      }
5198
 
5199
      private final short _thriftId;
5200
      private final String _fieldName;
5201
 
5202
      _Fields(short thriftId, String fieldName) {
5203
        _thriftId = thriftId;
5204
        _fieldName = fieldName;
5205
      }
5206
 
5207
      public short getThriftFieldId() {
5208
        return _thriftId;
5209
      }
5210
 
5211
      public String getFieldName() {
5212
        return _fieldName;
5213
      }
5214
    }
5215
 
5216
    // isset id assignments
5217
 
3430 rajveer 5218
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 5219
    static {
3430 rajveer 5220
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
5221
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5222
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
5223
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5224
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(trackCouponUsage_result.class, metaDataMap);
1982 varun.gupt 5225
    }
5226
 
5227
    public trackCouponUsage_result() {
5228
    }
5229
 
5230
    public trackCouponUsage_result(
5231
      PromotionException pex)
5232
    {
5233
      this();
5234
      this.pex = pex;
5235
    }
5236
 
5237
    /**
5238
     * Performs a deep copy on <i>other</i>.
5239
     */
5240
    public trackCouponUsage_result(trackCouponUsage_result other) {
5241
      if (other.isSetPex()) {
5242
        this.pex = new PromotionException(other.pex);
5243
      }
5244
    }
5245
 
5246
    public trackCouponUsage_result deepCopy() {
5247
      return new trackCouponUsage_result(this);
5248
    }
5249
 
3430 rajveer 5250
    @Override
5251
    public void clear() {
5252
      this.pex = null;
1982 varun.gupt 5253
    }
5254
 
5255
    public PromotionException getPex() {
5256
      return this.pex;
5257
    }
5258
 
3430 rajveer 5259
    public void setPex(PromotionException pex) {
1982 varun.gupt 5260
      this.pex = pex;
5261
    }
5262
 
5263
    public void unsetPex() {
5264
      this.pex = null;
5265
    }
5266
 
3430 rajveer 5267
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 5268
    public boolean isSetPex() {
5269
      return this.pex != null;
5270
    }
5271
 
5272
    public void setPexIsSet(boolean value) {
5273
      if (!value) {
5274
        this.pex = null;
5275
      }
5276
    }
5277
 
5278
    public void setFieldValue(_Fields field, Object value) {
5279
      switch (field) {
5280
      case PEX:
5281
        if (value == null) {
5282
          unsetPex();
5283
        } else {
5284
          setPex((PromotionException)value);
5285
        }
5286
        break;
5287
 
5288
      }
5289
    }
5290
 
5291
    public Object getFieldValue(_Fields field) {
5292
      switch (field) {
5293
      case PEX:
5294
        return getPex();
5295
 
5296
      }
5297
      throw new IllegalStateException();
5298
    }
5299
 
3430 rajveer 5300
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
5301
    public boolean isSet(_Fields field) {
5302
      if (field == null) {
5303
        throw new IllegalArgumentException();
5304
      }
1982 varun.gupt 5305
 
5306
      switch (field) {
5307
      case PEX:
5308
        return isSetPex();
5309
      }
5310
      throw new IllegalStateException();
5311
    }
5312
 
5313
    @Override
5314
    public boolean equals(Object that) {
5315
      if (that == null)
5316
        return false;
5317
      if (that instanceof trackCouponUsage_result)
5318
        return this.equals((trackCouponUsage_result)that);
5319
      return false;
5320
    }
5321
 
5322
    public boolean equals(trackCouponUsage_result that) {
5323
      if (that == null)
5324
        return false;
5325
 
5326
      boolean this_present_pex = true && this.isSetPex();
5327
      boolean that_present_pex = true && that.isSetPex();
5328
      if (this_present_pex || that_present_pex) {
5329
        if (!(this_present_pex && that_present_pex))
5330
          return false;
5331
        if (!this.pex.equals(that.pex))
5332
          return false;
5333
      }
5334
 
5335
      return true;
5336
    }
5337
 
5338
    @Override
5339
    public int hashCode() {
5340
      return 0;
5341
    }
5342
 
5343
    public int compareTo(trackCouponUsage_result other) {
5344
      if (!getClass().equals(other.getClass())) {
5345
        return getClass().getName().compareTo(other.getClass().getName());
5346
      }
5347
 
5348
      int lastComparison = 0;
5349
      trackCouponUsage_result typedOther = (trackCouponUsage_result)other;
5350
 
3430 rajveer 5351
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 5352
      if (lastComparison != 0) {
5353
        return lastComparison;
5354
      }
3430 rajveer 5355
      if (isSetPex()) {
5356
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
5357
        if (lastComparison != 0) {
5358
          return lastComparison;
5359
        }
1982 varun.gupt 5360
      }
5361
      return 0;
5362
    }
5363
 
3430 rajveer 5364
    public _Fields fieldForId(int fieldId) {
5365
      return _Fields.findByThriftId(fieldId);
5366
    }
5367
 
5368
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
5369
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 5370
      iprot.readStructBegin();
5371
      while (true)
5372
      {
5373
        field = iprot.readFieldBegin();
3430 rajveer 5374
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 5375
          break;
5376
        }
3430 rajveer 5377
        switch (field.id) {
5378
          case 1: // PEX
5379
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
5380
              this.pex = new PromotionException();
5381
              this.pex.read(iprot);
5382
            } else { 
5383
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5384
            }
5385
            break;
5386
          default:
5387
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 5388
        }
3430 rajveer 5389
        iprot.readFieldEnd();
1982 varun.gupt 5390
      }
5391
      iprot.readStructEnd();
5392
      validate();
5393
    }
5394
 
3430 rajveer 5395
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 5396
      oprot.writeStructBegin(STRUCT_DESC);
5397
 
5398
      if (this.isSetPex()) {
5399
        oprot.writeFieldBegin(PEX_FIELD_DESC);
5400
        this.pex.write(oprot);
5401
        oprot.writeFieldEnd();
5402
      }
5403
      oprot.writeFieldStop();
5404
      oprot.writeStructEnd();
5405
    }
5406
 
5407
    @Override
5408
    public String toString() {
5409
      StringBuilder sb = new StringBuilder("trackCouponUsage_result(");
5410
      boolean first = true;
5411
 
5412
      sb.append("pex:");
5413
      if (this.pex == null) {
5414
        sb.append("null");
5415
      } else {
5416
        sb.append(this.pex);
5417
      }
5418
      first = false;
5419
      sb.append(")");
5420
      return sb.toString();
5421
    }
5422
 
3430 rajveer 5423
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 5424
      // check for required fields
5425
    }
5426
 
3430 rajveer 5427
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5428
      try {
5429
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5430
      } catch (org.apache.thrift.TException te) {
5431
        throw new java.io.IOException(te);
5432
      }
5433
    }
5434
 
5435
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5436
      try {
5437
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5438
      } catch (org.apache.thrift.TException te) {
5439
        throw new java.io.IOException(te);
5440
      }
5441
    }
5442
 
1982 varun.gupt 5443
  }
5444
 
3430 rajveer 5445
  public static class getCouponUsageCountByUser_args implements org.apache.thrift.TBase<getCouponUsageCountByUser_args, getCouponUsageCountByUser_args._Fields>, java.io.Serializable, Cloneable   {
5446
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCouponUsageCountByUser_args");
1982 varun.gupt 5447
 
3430 rajveer 5448
    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);
5449
    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 5450
 
3430 rajveer 5451
    private String couponCode; // required
5452
    private long userId; // required
1982 varun.gupt 5453
 
5454
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 5455
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 5456
      COUPON_CODE((short)1, "couponCode"),
5457
      USER_ID((short)2, "userId");
5458
 
5459
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5460
 
5461
      static {
5462
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5463
          byName.put(field.getFieldName(), field);
5464
        }
5465
      }
5466
 
5467
      /**
5468
       * Find the _Fields constant that matches fieldId, or null if its not found.
5469
       */
5470
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 5471
        switch(fieldId) {
5472
          case 1: // COUPON_CODE
5473
            return COUPON_CODE;
5474
          case 2: // USER_ID
5475
            return USER_ID;
5476
          default:
5477
            return null;
5478
        }
1982 varun.gupt 5479
      }
5480
 
5481
      /**
5482
       * Find the _Fields constant that matches fieldId, throwing an exception
5483
       * if it is not found.
5484
       */
5485
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5486
        _Fields fields = findByThriftId(fieldId);
5487
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5488
        return fields;
5489
      }
5490
 
5491
      /**
5492
       * Find the _Fields constant that matches name, or null if its not found.
5493
       */
5494
      public static _Fields findByName(String name) {
5495
        return byName.get(name);
5496
      }
5497
 
5498
      private final short _thriftId;
5499
      private final String _fieldName;
5500
 
5501
      _Fields(short thriftId, String fieldName) {
5502
        _thriftId = thriftId;
5503
        _fieldName = fieldName;
5504
      }
5505
 
5506
      public short getThriftFieldId() {
5507
        return _thriftId;
5508
      }
5509
 
5510
      public String getFieldName() {
5511
        return _fieldName;
5512
      }
5513
    }
5514
 
5515
    // isset id assignments
5516
    private static final int __USERID_ISSET_ID = 0;
5517
    private BitSet __isset_bit_vector = new BitSet(1);
5518
 
3430 rajveer 5519
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 5520
    static {
3430 rajveer 5521
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
5522
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5523
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
5524
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5525
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
5526
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5527
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCouponUsageCountByUser_args.class, metaDataMap);
1982 varun.gupt 5528
    }
5529
 
5530
    public getCouponUsageCountByUser_args() {
5531
    }
5532
 
5533
    public getCouponUsageCountByUser_args(
5534
      String couponCode,
5535
      long userId)
5536
    {
5537
      this();
5538
      this.couponCode = couponCode;
5539
      this.userId = userId;
5540
      setUserIdIsSet(true);
5541
    }
5542
 
5543
    /**
5544
     * Performs a deep copy on <i>other</i>.
5545
     */
5546
    public getCouponUsageCountByUser_args(getCouponUsageCountByUser_args other) {
5547
      __isset_bit_vector.clear();
5548
      __isset_bit_vector.or(other.__isset_bit_vector);
5549
      if (other.isSetCouponCode()) {
5550
        this.couponCode = other.couponCode;
5551
      }
5552
      this.userId = other.userId;
5553
    }
5554
 
5555
    public getCouponUsageCountByUser_args deepCopy() {
5556
      return new getCouponUsageCountByUser_args(this);
5557
    }
5558
 
3430 rajveer 5559
    @Override
5560
    public void clear() {
5561
      this.couponCode = null;
5562
      setUserIdIsSet(false);
5563
      this.userId = 0;
1982 varun.gupt 5564
    }
5565
 
5566
    public String getCouponCode() {
5567
      return this.couponCode;
5568
    }
5569
 
3430 rajveer 5570
    public void setCouponCode(String couponCode) {
1982 varun.gupt 5571
      this.couponCode = couponCode;
5572
    }
5573
 
5574
    public void unsetCouponCode() {
5575
      this.couponCode = null;
5576
    }
5577
 
3430 rajveer 5578
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 5579
    public boolean isSetCouponCode() {
5580
      return this.couponCode != null;
5581
    }
5582
 
5583
    public void setCouponCodeIsSet(boolean value) {
5584
      if (!value) {
5585
        this.couponCode = null;
5586
      }
5587
    }
5588
 
5589
    public long getUserId() {
5590
      return this.userId;
5591
    }
5592
 
3430 rajveer 5593
    public void setUserId(long userId) {
1982 varun.gupt 5594
      this.userId = userId;
5595
      setUserIdIsSet(true);
5596
    }
5597
 
5598
    public void unsetUserId() {
5599
      __isset_bit_vector.clear(__USERID_ISSET_ID);
5600
    }
5601
 
3430 rajveer 5602
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 5603
    public boolean isSetUserId() {
5604
      return __isset_bit_vector.get(__USERID_ISSET_ID);
5605
    }
5606
 
5607
    public void setUserIdIsSet(boolean value) {
5608
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
5609
    }
5610
 
5611
    public void setFieldValue(_Fields field, Object value) {
5612
      switch (field) {
5613
      case COUPON_CODE:
5614
        if (value == null) {
5615
          unsetCouponCode();
5616
        } else {
5617
          setCouponCode((String)value);
5618
        }
5619
        break;
5620
 
5621
      case USER_ID:
5622
        if (value == null) {
5623
          unsetUserId();
5624
        } else {
5625
          setUserId((Long)value);
5626
        }
5627
        break;
5628
 
5629
      }
5630
    }
5631
 
5632
    public Object getFieldValue(_Fields field) {
5633
      switch (field) {
5634
      case COUPON_CODE:
5635
        return getCouponCode();
5636
 
5637
      case USER_ID:
3430 rajveer 5638
        return Long.valueOf(getUserId());
1982 varun.gupt 5639
 
5640
      }
5641
      throw new IllegalStateException();
5642
    }
5643
 
3430 rajveer 5644
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
5645
    public boolean isSet(_Fields field) {
5646
      if (field == null) {
5647
        throw new IllegalArgumentException();
5648
      }
1982 varun.gupt 5649
 
5650
      switch (field) {
5651
      case COUPON_CODE:
5652
        return isSetCouponCode();
5653
      case USER_ID:
5654
        return isSetUserId();
5655
      }
5656
      throw new IllegalStateException();
5657
    }
5658
 
5659
    @Override
5660
    public boolean equals(Object that) {
5661
      if (that == null)
5662
        return false;
5663
      if (that instanceof getCouponUsageCountByUser_args)
5664
        return this.equals((getCouponUsageCountByUser_args)that);
5665
      return false;
5666
    }
5667
 
5668
    public boolean equals(getCouponUsageCountByUser_args that) {
5669
      if (that == null)
5670
        return false;
5671
 
5672
      boolean this_present_couponCode = true && this.isSetCouponCode();
5673
      boolean that_present_couponCode = true && that.isSetCouponCode();
5674
      if (this_present_couponCode || that_present_couponCode) {
5675
        if (!(this_present_couponCode && that_present_couponCode))
5676
          return false;
5677
        if (!this.couponCode.equals(that.couponCode))
5678
          return false;
5679
      }
5680
 
5681
      boolean this_present_userId = true;
5682
      boolean that_present_userId = true;
5683
      if (this_present_userId || that_present_userId) {
5684
        if (!(this_present_userId && that_present_userId))
5685
          return false;
5686
        if (this.userId != that.userId)
5687
          return false;
5688
      }
5689
 
5690
      return true;
5691
    }
5692
 
5693
    @Override
5694
    public int hashCode() {
5695
      return 0;
5696
    }
5697
 
5698
    public int compareTo(getCouponUsageCountByUser_args other) {
5699
      if (!getClass().equals(other.getClass())) {
5700
        return getClass().getName().compareTo(other.getClass().getName());
5701
      }
5702
 
5703
      int lastComparison = 0;
5704
      getCouponUsageCountByUser_args typedOther = (getCouponUsageCountByUser_args)other;
5705
 
3430 rajveer 5706
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 5707
      if (lastComparison != 0) {
5708
        return lastComparison;
5709
      }
3430 rajveer 5710
      if (isSetCouponCode()) {
5711
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
5712
        if (lastComparison != 0) {
5713
          return lastComparison;
5714
        }
1982 varun.gupt 5715
      }
3430 rajveer 5716
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
1982 varun.gupt 5717
      if (lastComparison != 0) {
5718
        return lastComparison;
5719
      }
3430 rajveer 5720
      if (isSetUserId()) {
5721
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
5722
        if (lastComparison != 0) {
5723
          return lastComparison;
5724
        }
1982 varun.gupt 5725
      }
5726
      return 0;
5727
    }
5728
 
3430 rajveer 5729
    public _Fields fieldForId(int fieldId) {
5730
      return _Fields.findByThriftId(fieldId);
5731
    }
5732
 
5733
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
5734
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 5735
      iprot.readStructBegin();
5736
      while (true)
5737
      {
5738
        field = iprot.readFieldBegin();
3430 rajveer 5739
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 5740
          break;
5741
        }
3430 rajveer 5742
        switch (field.id) {
5743
          case 1: // COUPON_CODE
5744
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
5745
              this.couponCode = iprot.readString();
5746
            } else { 
5747
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5748
            }
5749
            break;
5750
          case 2: // USER_ID
5751
            if (field.type == org.apache.thrift.protocol.TType.I64) {
5752
              this.userId = iprot.readI64();
5753
              setUserIdIsSet(true);
5754
            } else { 
5755
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5756
            }
5757
            break;
5758
          default:
5759
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 5760
        }
3430 rajveer 5761
        iprot.readFieldEnd();
1982 varun.gupt 5762
      }
5763
      iprot.readStructEnd();
5764
      validate();
5765
    }
5766
 
3430 rajveer 5767
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 5768
      validate();
5769
 
5770
      oprot.writeStructBegin(STRUCT_DESC);
5771
      if (this.couponCode != null) {
5772
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
5773
        oprot.writeString(this.couponCode);
5774
        oprot.writeFieldEnd();
5775
      }
5776
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
5777
      oprot.writeI64(this.userId);
5778
      oprot.writeFieldEnd();
5779
      oprot.writeFieldStop();
5780
      oprot.writeStructEnd();
5781
    }
5782
 
5783
    @Override
5784
    public String toString() {
5785
      StringBuilder sb = new StringBuilder("getCouponUsageCountByUser_args(");
5786
      boolean first = true;
5787
 
5788
      sb.append("couponCode:");
5789
      if (this.couponCode == null) {
5790
        sb.append("null");
5791
      } else {
5792
        sb.append(this.couponCode);
5793
      }
5794
      first = false;
5795
      if (!first) sb.append(", ");
5796
      sb.append("userId:");
5797
      sb.append(this.userId);
5798
      first = false;
5799
      sb.append(")");
5800
      return sb.toString();
5801
    }
5802
 
3430 rajveer 5803
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 5804
      // check for required fields
5805
    }
5806
 
3430 rajveer 5807
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5808
      try {
5809
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5810
      } catch (org.apache.thrift.TException te) {
5811
        throw new java.io.IOException(te);
5812
      }
5813
    }
5814
 
5815
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5816
      try {
5817
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
5818
        __isset_bit_vector = new BitSet(1);
5819
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5820
      } catch (org.apache.thrift.TException te) {
5821
        throw new java.io.IOException(te);
5822
      }
5823
    }
5824
 
1982 varun.gupt 5825
  }
5826
 
3430 rajveer 5827
  public static class getCouponUsageCountByUser_result implements org.apache.thrift.TBase<getCouponUsageCountByUser_result, getCouponUsageCountByUser_result._Fields>, java.io.Serializable, Cloneable   {
5828
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCouponUsageCountByUser_result");
1982 varun.gupt 5829
 
3430 rajveer 5830
    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);
5831
    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 5832
 
3430 rajveer 5833
    private long success; // required
5834
    private PromotionException pex; // required
1982 varun.gupt 5835
 
5836
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 5837
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 5838
      SUCCESS((short)0, "success"),
5839
      PEX((short)1, "pex");
5840
 
5841
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5842
 
5843
      static {
5844
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5845
          byName.put(field.getFieldName(), field);
5846
        }
5847
      }
5848
 
5849
      /**
5850
       * Find the _Fields constant that matches fieldId, or null if its not found.
5851
       */
5852
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 5853
        switch(fieldId) {
5854
          case 0: // SUCCESS
5855
            return SUCCESS;
5856
          case 1: // PEX
5857
            return PEX;
5858
          default:
5859
            return null;
5860
        }
1982 varun.gupt 5861
      }
5862
 
5863
      /**
5864
       * Find the _Fields constant that matches fieldId, throwing an exception
5865
       * if it is not found.
5866
       */
5867
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5868
        _Fields fields = findByThriftId(fieldId);
5869
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5870
        return fields;
5871
      }
5872
 
5873
      /**
5874
       * Find the _Fields constant that matches name, or null if its not found.
5875
       */
5876
      public static _Fields findByName(String name) {
5877
        return byName.get(name);
5878
      }
5879
 
5880
      private final short _thriftId;
5881
      private final String _fieldName;
5882
 
5883
      _Fields(short thriftId, String fieldName) {
5884
        _thriftId = thriftId;
5885
        _fieldName = fieldName;
5886
      }
5887
 
5888
      public short getThriftFieldId() {
5889
        return _thriftId;
5890
      }
5891
 
5892
      public String getFieldName() {
5893
        return _fieldName;
5894
      }
5895
    }
5896
 
5897
    // isset id assignments
5898
    private static final int __SUCCESS_ISSET_ID = 0;
5899
    private BitSet __isset_bit_vector = new BitSet(1);
5900
 
3430 rajveer 5901
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 5902
    static {
3430 rajveer 5903
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
5904
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5905
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
5906
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5907
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
5908
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5909
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCouponUsageCountByUser_result.class, metaDataMap);
1982 varun.gupt 5910
    }
5911
 
5912
    public getCouponUsageCountByUser_result() {
5913
    }
5914
 
5915
    public getCouponUsageCountByUser_result(
5916
      long success,
5917
      PromotionException pex)
5918
    {
5919
      this();
5920
      this.success = success;
5921
      setSuccessIsSet(true);
5922
      this.pex = pex;
5923
    }
5924
 
5925
    /**
5926
     * Performs a deep copy on <i>other</i>.
5927
     */
5928
    public getCouponUsageCountByUser_result(getCouponUsageCountByUser_result other) {
5929
      __isset_bit_vector.clear();
5930
      __isset_bit_vector.or(other.__isset_bit_vector);
5931
      this.success = other.success;
5932
      if (other.isSetPex()) {
5933
        this.pex = new PromotionException(other.pex);
5934
      }
5935
    }
5936
 
5937
    public getCouponUsageCountByUser_result deepCopy() {
5938
      return new getCouponUsageCountByUser_result(this);
5939
    }
5940
 
3430 rajveer 5941
    @Override
5942
    public void clear() {
5943
      setSuccessIsSet(false);
5944
      this.success = 0;
5945
      this.pex = null;
1982 varun.gupt 5946
    }
5947
 
5948
    public long getSuccess() {
5949
      return this.success;
5950
    }
5951
 
3430 rajveer 5952
    public void setSuccess(long success) {
1982 varun.gupt 5953
      this.success = success;
5954
      setSuccessIsSet(true);
5955
    }
5956
 
5957
    public void unsetSuccess() {
5958
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
5959
    }
5960
 
3430 rajveer 5961
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 5962
    public boolean isSetSuccess() {
5963
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
5964
    }
5965
 
5966
    public void setSuccessIsSet(boolean value) {
5967
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
5968
    }
5969
 
5970
    public PromotionException getPex() {
5971
      return this.pex;
5972
    }
5973
 
3430 rajveer 5974
    public void setPex(PromotionException pex) {
1982 varun.gupt 5975
      this.pex = pex;
5976
    }
5977
 
5978
    public void unsetPex() {
5979
      this.pex = null;
5980
    }
5981
 
3430 rajveer 5982
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 5983
    public boolean isSetPex() {
5984
      return this.pex != null;
5985
    }
5986
 
5987
    public void setPexIsSet(boolean value) {
5988
      if (!value) {
5989
        this.pex = null;
5990
      }
5991
    }
5992
 
5993
    public void setFieldValue(_Fields field, Object value) {
5994
      switch (field) {
5995
      case SUCCESS:
5996
        if (value == null) {
5997
          unsetSuccess();
5998
        } else {
5999
          setSuccess((Long)value);
6000
        }
6001
        break;
6002
 
6003
      case PEX:
6004
        if (value == null) {
6005
          unsetPex();
6006
        } else {
6007
          setPex((PromotionException)value);
6008
        }
6009
        break;
6010
 
6011
      }
6012
    }
6013
 
6014
    public Object getFieldValue(_Fields field) {
6015
      switch (field) {
6016
      case SUCCESS:
3430 rajveer 6017
        return Long.valueOf(getSuccess());
1982 varun.gupt 6018
 
6019
      case PEX:
6020
        return getPex();
6021
 
6022
      }
6023
      throw new IllegalStateException();
6024
    }
6025
 
3430 rajveer 6026
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
6027
    public boolean isSet(_Fields field) {
6028
      if (field == null) {
6029
        throw new IllegalArgumentException();
6030
      }
1982 varun.gupt 6031
 
6032
      switch (field) {
6033
      case SUCCESS:
6034
        return isSetSuccess();
6035
      case PEX:
6036
        return isSetPex();
6037
      }
6038
      throw new IllegalStateException();
6039
    }
6040
 
6041
    @Override
6042
    public boolean equals(Object that) {
6043
      if (that == null)
6044
        return false;
6045
      if (that instanceof getCouponUsageCountByUser_result)
6046
        return this.equals((getCouponUsageCountByUser_result)that);
6047
      return false;
6048
    }
6049
 
6050
    public boolean equals(getCouponUsageCountByUser_result that) {
6051
      if (that == null)
6052
        return false;
6053
 
6054
      boolean this_present_success = true;
6055
      boolean that_present_success = true;
6056
      if (this_present_success || that_present_success) {
6057
        if (!(this_present_success && that_present_success))
6058
          return false;
6059
        if (this.success != that.success)
6060
          return false;
6061
      }
6062
 
6063
      boolean this_present_pex = true && this.isSetPex();
6064
      boolean that_present_pex = true && that.isSetPex();
6065
      if (this_present_pex || that_present_pex) {
6066
        if (!(this_present_pex && that_present_pex))
6067
          return false;
6068
        if (!this.pex.equals(that.pex))
6069
          return false;
6070
      }
6071
 
6072
      return true;
6073
    }
6074
 
6075
    @Override
6076
    public int hashCode() {
6077
      return 0;
6078
    }
6079
 
6080
    public int compareTo(getCouponUsageCountByUser_result other) {
6081
      if (!getClass().equals(other.getClass())) {
6082
        return getClass().getName().compareTo(other.getClass().getName());
6083
      }
6084
 
6085
      int lastComparison = 0;
6086
      getCouponUsageCountByUser_result typedOther = (getCouponUsageCountByUser_result)other;
6087
 
3430 rajveer 6088
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 6089
      if (lastComparison != 0) {
6090
        return lastComparison;
6091
      }
3430 rajveer 6092
      if (isSetSuccess()) {
6093
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
6094
        if (lastComparison != 0) {
6095
          return lastComparison;
6096
        }
1982 varun.gupt 6097
      }
3430 rajveer 6098
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 6099
      if (lastComparison != 0) {
6100
        return lastComparison;
6101
      }
3430 rajveer 6102
      if (isSetPex()) {
6103
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
6104
        if (lastComparison != 0) {
6105
          return lastComparison;
6106
        }
1982 varun.gupt 6107
      }
6108
      return 0;
6109
    }
6110
 
3430 rajveer 6111
    public _Fields fieldForId(int fieldId) {
6112
      return _Fields.findByThriftId(fieldId);
6113
    }
6114
 
6115
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
6116
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 6117
      iprot.readStructBegin();
6118
      while (true)
6119
      {
6120
        field = iprot.readFieldBegin();
3430 rajveer 6121
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 6122
          break;
6123
        }
3430 rajveer 6124
        switch (field.id) {
6125
          case 0: // SUCCESS
6126
            if (field.type == org.apache.thrift.protocol.TType.I64) {
6127
              this.success = iprot.readI64();
6128
              setSuccessIsSet(true);
6129
            } else { 
6130
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6131
            }
6132
            break;
6133
          case 1: // PEX
6134
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
6135
              this.pex = new PromotionException();
6136
              this.pex.read(iprot);
6137
            } else { 
6138
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6139
            }
6140
            break;
6141
          default:
6142
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 6143
        }
3430 rajveer 6144
        iprot.readFieldEnd();
1982 varun.gupt 6145
      }
6146
      iprot.readStructEnd();
6147
      validate();
6148
    }
6149
 
3430 rajveer 6150
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 6151
      oprot.writeStructBegin(STRUCT_DESC);
6152
 
6153
      if (this.isSetSuccess()) {
6154
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
6155
        oprot.writeI64(this.success);
6156
        oprot.writeFieldEnd();
6157
      } else if (this.isSetPex()) {
6158
        oprot.writeFieldBegin(PEX_FIELD_DESC);
6159
        this.pex.write(oprot);
6160
        oprot.writeFieldEnd();
6161
      }
6162
      oprot.writeFieldStop();
6163
      oprot.writeStructEnd();
6164
    }
6165
 
6166
    @Override
6167
    public String toString() {
6168
      StringBuilder sb = new StringBuilder("getCouponUsageCountByUser_result(");
6169
      boolean first = true;
6170
 
6171
      sb.append("success:");
6172
      sb.append(this.success);
6173
      first = false;
6174
      if (!first) sb.append(", ");
6175
      sb.append("pex:");
6176
      if (this.pex == null) {
6177
        sb.append("null");
6178
      } else {
6179
        sb.append(this.pex);
6180
      }
6181
      first = false;
6182
      sb.append(")");
6183
      return sb.toString();
6184
    }
6185
 
3430 rajveer 6186
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 6187
      // check for required fields
6188
    }
6189
 
3430 rajveer 6190
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
6191
      try {
6192
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
6193
      } catch (org.apache.thrift.TException te) {
6194
        throw new java.io.IOException(te);
6195
      }
6196
    }
6197
 
6198
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
6199
      try {
6200
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
6201
      } catch (org.apache.thrift.TException te) {
6202
        throw new java.io.IOException(te);
6203
      }
6204
    }
6205
 
1982 varun.gupt 6206
  }
6207
 
3430 rajveer 6208
  public static class getActiveCoupons_args implements org.apache.thrift.TBase<getActiveCoupons_args, getActiveCoupons_args._Fields>, java.io.Serializable, Cloneable   {
6209
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActiveCoupons_args");
3385 varun.gupt 6210
 
6211
 
6212
 
6213
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 6214
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 6215
;
6216
 
6217
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6218
 
6219
      static {
6220
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6221
          byName.put(field.getFieldName(), field);
6222
        }
6223
      }
6224
 
6225
      /**
6226
       * Find the _Fields constant that matches fieldId, or null if its not found.
6227
       */
6228
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 6229
        switch(fieldId) {
6230
          default:
6231
            return null;
6232
        }
3385 varun.gupt 6233
      }
6234
 
6235
      /**
6236
       * Find the _Fields constant that matches fieldId, throwing an exception
6237
       * if it is not found.
6238
       */
6239
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6240
        _Fields fields = findByThriftId(fieldId);
6241
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6242
        return fields;
6243
      }
6244
 
6245
      /**
6246
       * Find the _Fields constant that matches name, or null if its not found.
6247
       */
6248
      public static _Fields findByName(String name) {
6249
        return byName.get(name);
6250
      }
6251
 
6252
      private final short _thriftId;
6253
      private final String _fieldName;
6254
 
6255
      _Fields(short thriftId, String fieldName) {
6256
        _thriftId = thriftId;
6257
        _fieldName = fieldName;
6258
      }
6259
 
6260
      public short getThriftFieldId() {
6261
        return _thriftId;
6262
      }
6263
 
6264
      public String getFieldName() {
6265
        return _fieldName;
6266
      }
6267
    }
3430 rajveer 6268
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 6269
    static {
3430 rajveer 6270
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
6271
      metaDataMap = Collections.unmodifiableMap(tmpMap);
6272
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActiveCoupons_args.class, metaDataMap);
3385 varun.gupt 6273
    }
6274
 
6275
    public getActiveCoupons_args() {
6276
    }
6277
 
6278
    /**
6279
     * Performs a deep copy on <i>other</i>.
6280
     */
6281
    public getActiveCoupons_args(getActiveCoupons_args other) {
6282
    }
6283
 
6284
    public getActiveCoupons_args deepCopy() {
6285
      return new getActiveCoupons_args(this);
6286
    }
6287
 
3430 rajveer 6288
    @Override
6289
    public void clear() {
3385 varun.gupt 6290
    }
6291
 
6292
    public void setFieldValue(_Fields field, Object value) {
6293
      switch (field) {
6294
      }
6295
    }
6296
 
6297
    public Object getFieldValue(_Fields field) {
6298
      switch (field) {
6299
      }
6300
      throw new IllegalStateException();
6301
    }
6302
 
3430 rajveer 6303
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
6304
    public boolean isSet(_Fields field) {
6305
      if (field == null) {
6306
        throw new IllegalArgumentException();
6307
      }
3385 varun.gupt 6308
 
6309
      switch (field) {
6310
      }
6311
      throw new IllegalStateException();
6312
    }
6313
 
6314
    @Override
6315
    public boolean equals(Object that) {
6316
      if (that == null)
6317
        return false;
6318
      if (that instanceof getActiveCoupons_args)
6319
        return this.equals((getActiveCoupons_args)that);
6320
      return false;
6321
    }
6322
 
6323
    public boolean equals(getActiveCoupons_args that) {
6324
      if (that == null)
6325
        return false;
6326
 
6327
      return true;
6328
    }
6329
 
6330
    @Override
6331
    public int hashCode() {
6332
      return 0;
6333
    }
6334
 
6335
    public int compareTo(getActiveCoupons_args other) {
6336
      if (!getClass().equals(other.getClass())) {
6337
        return getClass().getName().compareTo(other.getClass().getName());
6338
      }
6339
 
6340
      int lastComparison = 0;
6341
      getActiveCoupons_args typedOther = (getActiveCoupons_args)other;
6342
 
6343
      return 0;
6344
    }
6345
 
3430 rajveer 6346
    public _Fields fieldForId(int fieldId) {
6347
      return _Fields.findByThriftId(fieldId);
6348
    }
6349
 
6350
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
6351
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 6352
      iprot.readStructBegin();
6353
      while (true)
6354
      {
6355
        field = iprot.readFieldBegin();
3430 rajveer 6356
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 6357
          break;
6358
        }
3430 rajveer 6359
        switch (field.id) {
6360
          default:
6361
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 6362
        }
3430 rajveer 6363
        iprot.readFieldEnd();
3385 varun.gupt 6364
      }
6365
      iprot.readStructEnd();
6366
      validate();
6367
    }
6368
 
3430 rajveer 6369
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 6370
      validate();
6371
 
6372
      oprot.writeStructBegin(STRUCT_DESC);
6373
      oprot.writeFieldStop();
6374
      oprot.writeStructEnd();
6375
    }
6376
 
6377
    @Override
6378
    public String toString() {
6379
      StringBuilder sb = new StringBuilder("getActiveCoupons_args(");
6380
      boolean first = true;
6381
 
6382
      sb.append(")");
6383
      return sb.toString();
6384
    }
6385
 
3430 rajveer 6386
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 6387
      // check for required fields
6388
    }
6389
 
3430 rajveer 6390
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
6391
      try {
6392
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
6393
      } catch (org.apache.thrift.TException te) {
6394
        throw new java.io.IOException(te);
6395
      }
6396
    }
6397
 
6398
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
6399
      try {
6400
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
6401
      } catch (org.apache.thrift.TException te) {
6402
        throw new java.io.IOException(te);
6403
      }
6404
    }
6405
 
3385 varun.gupt 6406
  }
6407
 
3430 rajveer 6408
  public static class getActiveCoupons_result implements org.apache.thrift.TBase<getActiveCoupons_result, getActiveCoupons_result._Fields>, java.io.Serializable, Cloneable   {
6409
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActiveCoupons_result");
3385 varun.gupt 6410
 
3430 rajveer 6411
    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);
6412
    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 6413
 
3430 rajveer 6414
    private List<Coupon> success; // required
6415
    private PromotionException pex; // required
3385 varun.gupt 6416
 
6417
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 6418
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 6419
      SUCCESS((short)0, "success"),
6420
      PEX((short)1, "pex");
6421
 
6422
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6423
 
6424
      static {
6425
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6426
          byName.put(field.getFieldName(), field);
6427
        }
6428
      }
6429
 
6430
      /**
6431
       * Find the _Fields constant that matches fieldId, or null if its not found.
6432
       */
6433
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 6434
        switch(fieldId) {
6435
          case 0: // SUCCESS
6436
            return SUCCESS;
6437
          case 1: // PEX
6438
            return PEX;
6439
          default:
6440
            return null;
6441
        }
3385 varun.gupt 6442
      }
6443
 
6444
      /**
6445
       * Find the _Fields constant that matches fieldId, throwing an exception
6446
       * if it is not found.
6447
       */
6448
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6449
        _Fields fields = findByThriftId(fieldId);
6450
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6451
        return fields;
6452
      }
6453
 
6454
      /**
6455
       * Find the _Fields constant that matches name, or null if its not found.
6456
       */
6457
      public static _Fields findByName(String name) {
6458
        return byName.get(name);
6459
      }
6460
 
6461
      private final short _thriftId;
6462
      private final String _fieldName;
6463
 
6464
      _Fields(short thriftId, String fieldName) {
6465
        _thriftId = thriftId;
6466
        _fieldName = fieldName;
6467
      }
6468
 
6469
      public short getThriftFieldId() {
6470
        return _thriftId;
6471
      }
6472
 
6473
      public String getFieldName() {
6474
        return _fieldName;
6475
      }
6476
    }
6477
 
6478
    // isset id assignments
6479
 
3430 rajveer 6480
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 6481
    static {
3430 rajveer 6482
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
6483
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6484
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
6485
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Coupon.class))));
6486
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6487
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
6488
      metaDataMap = Collections.unmodifiableMap(tmpMap);
6489
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActiveCoupons_result.class, metaDataMap);
3385 varun.gupt 6490
    }
6491
 
6492
    public getActiveCoupons_result() {
6493
    }
6494
 
6495
    public getActiveCoupons_result(
6496
      List<Coupon> success,
6497
      PromotionException pex)
6498
    {
6499
      this();
6500
      this.success = success;
6501
      this.pex = pex;
6502
    }
6503
 
6504
    /**
6505
     * Performs a deep copy on <i>other</i>.
6506
     */
6507
    public getActiveCoupons_result(getActiveCoupons_result other) {
6508
      if (other.isSetSuccess()) {
6509
        List<Coupon> __this__success = new ArrayList<Coupon>();
6510
        for (Coupon other_element : other.success) {
6511
          __this__success.add(new Coupon(other_element));
6512
        }
6513
        this.success = __this__success;
6514
      }
6515
      if (other.isSetPex()) {
6516
        this.pex = new PromotionException(other.pex);
6517
      }
6518
    }
6519
 
6520
    public getActiveCoupons_result deepCopy() {
6521
      return new getActiveCoupons_result(this);
6522
    }
6523
 
3430 rajveer 6524
    @Override
6525
    public void clear() {
6526
      this.success = null;
6527
      this.pex = null;
3385 varun.gupt 6528
    }
6529
 
6530
    public int getSuccessSize() {
6531
      return (this.success == null) ? 0 : this.success.size();
6532
    }
6533
 
6534
    public java.util.Iterator<Coupon> getSuccessIterator() {
6535
      return (this.success == null) ? null : this.success.iterator();
6536
    }
6537
 
6538
    public void addToSuccess(Coupon elem) {
6539
      if (this.success == null) {
6540
        this.success = new ArrayList<Coupon>();
6541
      }
6542
      this.success.add(elem);
6543
    }
6544
 
6545
    public List<Coupon> getSuccess() {
6546
      return this.success;
6547
    }
6548
 
3430 rajveer 6549
    public void setSuccess(List<Coupon> success) {
3385 varun.gupt 6550
      this.success = success;
6551
    }
6552
 
6553
    public void unsetSuccess() {
6554
      this.success = null;
6555
    }
6556
 
3430 rajveer 6557
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3385 varun.gupt 6558
    public boolean isSetSuccess() {
6559
      return this.success != null;
6560
    }
6561
 
6562
    public void setSuccessIsSet(boolean value) {
6563
      if (!value) {
6564
        this.success = null;
6565
      }
6566
    }
6567
 
6568
    public PromotionException getPex() {
6569
      return this.pex;
6570
    }
6571
 
3430 rajveer 6572
    public void setPex(PromotionException pex) {
3385 varun.gupt 6573
      this.pex = pex;
6574
    }
6575
 
6576
    public void unsetPex() {
6577
      this.pex = null;
6578
    }
6579
 
3430 rajveer 6580
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
3385 varun.gupt 6581
    public boolean isSetPex() {
6582
      return this.pex != null;
6583
    }
6584
 
6585
    public void setPexIsSet(boolean value) {
6586
      if (!value) {
6587
        this.pex = null;
6588
      }
6589
    }
6590
 
6591
    public void setFieldValue(_Fields field, Object value) {
6592
      switch (field) {
6593
      case SUCCESS:
6594
        if (value == null) {
6595
          unsetSuccess();
6596
        } else {
6597
          setSuccess((List<Coupon>)value);
6598
        }
6599
        break;
6600
 
6601
      case PEX:
6602
        if (value == null) {
6603
          unsetPex();
6604
        } else {
6605
          setPex((PromotionException)value);
6606
        }
6607
        break;
6608
 
6609
      }
6610
    }
6611
 
6612
    public Object getFieldValue(_Fields field) {
6613
      switch (field) {
6614
      case SUCCESS:
6615
        return getSuccess();
6616
 
6617
      case PEX:
6618
        return getPex();
6619
 
6620
      }
6621
      throw new IllegalStateException();
6622
    }
6623
 
3430 rajveer 6624
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
6625
    public boolean isSet(_Fields field) {
6626
      if (field == null) {
6627
        throw new IllegalArgumentException();
6628
      }
3385 varun.gupt 6629
 
6630
      switch (field) {
6631
      case SUCCESS:
6632
        return isSetSuccess();
6633
      case PEX:
6634
        return isSetPex();
6635
      }
6636
      throw new IllegalStateException();
6637
    }
6638
 
6639
    @Override
6640
    public boolean equals(Object that) {
6641
      if (that == null)
6642
        return false;
6643
      if (that instanceof getActiveCoupons_result)
6644
        return this.equals((getActiveCoupons_result)that);
6645
      return false;
6646
    }
6647
 
6648
    public boolean equals(getActiveCoupons_result that) {
6649
      if (that == null)
6650
        return false;
6651
 
6652
      boolean this_present_success = true && this.isSetSuccess();
6653
      boolean that_present_success = true && that.isSetSuccess();
6654
      if (this_present_success || that_present_success) {
6655
        if (!(this_present_success && that_present_success))
6656
          return false;
6657
        if (!this.success.equals(that.success))
6658
          return false;
6659
      }
6660
 
6661
      boolean this_present_pex = true && this.isSetPex();
6662
      boolean that_present_pex = true && that.isSetPex();
6663
      if (this_present_pex || that_present_pex) {
6664
        if (!(this_present_pex && that_present_pex))
6665
          return false;
6666
        if (!this.pex.equals(that.pex))
6667
          return false;
6668
      }
6669
 
6670
      return true;
6671
    }
6672
 
6673
    @Override
6674
    public int hashCode() {
6675
      return 0;
6676
    }
6677
 
6678
    public int compareTo(getActiveCoupons_result other) {
6679
      if (!getClass().equals(other.getClass())) {
6680
        return getClass().getName().compareTo(other.getClass().getName());
6681
      }
6682
 
6683
      int lastComparison = 0;
6684
      getActiveCoupons_result typedOther = (getActiveCoupons_result)other;
6685
 
3430 rajveer 6686
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3385 varun.gupt 6687
      if (lastComparison != 0) {
6688
        return lastComparison;
6689
      }
3430 rajveer 6690
      if (isSetSuccess()) {
6691
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
6692
        if (lastComparison != 0) {
6693
          return lastComparison;
6694
        }
3385 varun.gupt 6695
      }
3430 rajveer 6696
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
3385 varun.gupt 6697
      if (lastComparison != 0) {
6698
        return lastComparison;
6699
      }
3430 rajveer 6700
      if (isSetPex()) {
6701
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
6702
        if (lastComparison != 0) {
6703
          return lastComparison;
6704
        }
3385 varun.gupt 6705
      }
6706
      return 0;
6707
    }
6708
 
3430 rajveer 6709
    public _Fields fieldForId(int fieldId) {
6710
      return _Fields.findByThriftId(fieldId);
6711
    }
6712
 
6713
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
6714
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 6715
      iprot.readStructBegin();
6716
      while (true)
6717
      {
6718
        field = iprot.readFieldBegin();
3430 rajveer 6719
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 6720
          break;
6721
        }
3430 rajveer 6722
        switch (field.id) {
6723
          case 0: // SUCCESS
6724
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
6725
              {
5327 rajveer 6726
                org.apache.thrift.protocol.TList _list16 = iprot.readListBegin();
6727
                this.success = new ArrayList<Coupon>(_list16.size);
6728
                for (int _i17 = 0; _i17 < _list16.size; ++_i17)
3385 varun.gupt 6729
                {
5327 rajveer 6730
                  Coupon _elem18; // required
6731
                  _elem18 = new Coupon();
6732
                  _elem18.read(iprot);
6733
                  this.success.add(_elem18);
3385 varun.gupt 6734
                }
3430 rajveer 6735
                iprot.readListEnd();
3385 varun.gupt 6736
              }
3430 rajveer 6737
            } else { 
6738
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6739
            }
6740
            break;
6741
          case 1: // PEX
6742
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
6743
              this.pex = new PromotionException();
6744
              this.pex.read(iprot);
6745
            } else { 
6746
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6747
            }
6748
            break;
6749
          default:
6750
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 6751
        }
3430 rajveer 6752
        iprot.readFieldEnd();
3385 varun.gupt 6753
      }
6754
      iprot.readStructEnd();
6755
      validate();
6756
    }
6757
 
3430 rajveer 6758
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 6759
      oprot.writeStructBegin(STRUCT_DESC);
6760
 
6761
      if (this.isSetSuccess()) {
6762
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
6763
        {
3430 rajveer 6764
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
5327 rajveer 6765
          for (Coupon _iter19 : this.success)
3385 varun.gupt 6766
          {
5327 rajveer 6767
            _iter19.write(oprot);
3385 varun.gupt 6768
          }
6769
          oprot.writeListEnd();
6770
        }
6771
        oprot.writeFieldEnd();
6772
      } else if (this.isSetPex()) {
6773
        oprot.writeFieldBegin(PEX_FIELD_DESC);
6774
        this.pex.write(oprot);
6775
        oprot.writeFieldEnd();
6776
      }
6777
      oprot.writeFieldStop();
6778
      oprot.writeStructEnd();
6779
    }
6780
 
6781
    @Override
6782
    public String toString() {
6783
      StringBuilder sb = new StringBuilder("getActiveCoupons_result(");
6784
      boolean first = true;
6785
 
6786
      sb.append("success:");
6787
      if (this.success == null) {
6788
        sb.append("null");
6789
      } else {
6790
        sb.append(this.success);
6791
      }
6792
      first = false;
6793
      if (!first) sb.append(", ");
6794
      sb.append("pex:");
6795
      if (this.pex == null) {
6796
        sb.append("null");
6797
      } else {
6798
        sb.append(this.pex);
6799
      }
6800
      first = false;
6801
      sb.append(")");
6802
      return sb.toString();
6803
    }
6804
 
3430 rajveer 6805
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 6806
      // check for required fields
6807
    }
6808
 
3430 rajveer 6809
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
6810
      try {
6811
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
6812
      } catch (org.apache.thrift.TException te) {
6813
        throw new java.io.IOException(te);
6814
      }
6815
    }
6816
 
6817
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
6818
      try {
6819
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
6820
      } catch (org.apache.thrift.TException te) {
6821
        throw new java.io.IOException(te);
6822
      }
6823
    }
6824
 
3385 varun.gupt 6825
  }
6826
 
3430 rajveer 6827
  public static class getSuccessfulPaymentCountForCoupon_args implements org.apache.thrift.TBase<getSuccessfulPaymentCountForCoupon_args, getSuccessfulPaymentCountForCoupon_args._Fields>, java.io.Serializable, Cloneable   {
6828
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSuccessfulPaymentCountForCoupon_args");
3385 varun.gupt 6829
 
3430 rajveer 6830
    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 6831
 
3430 rajveer 6832
    private String couponCode; // required
3385 varun.gupt 6833
 
6834
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 6835
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 6836
      COUPON_CODE((short)1, "couponCode");
6837
 
6838
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6839
 
6840
      static {
6841
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6842
          byName.put(field.getFieldName(), field);
6843
        }
6844
      }
6845
 
6846
      /**
6847
       * Find the _Fields constant that matches fieldId, or null if its not found.
6848
       */
6849
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 6850
        switch(fieldId) {
6851
          case 1: // COUPON_CODE
6852
            return COUPON_CODE;
6853
          default:
6854
            return null;
6855
        }
3385 varun.gupt 6856
      }
6857
 
6858
      /**
6859
       * Find the _Fields constant that matches fieldId, throwing an exception
6860
       * if it is not found.
6861
       */
6862
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6863
        _Fields fields = findByThriftId(fieldId);
6864
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6865
        return fields;
6866
      }
6867
 
6868
      /**
6869
       * Find the _Fields constant that matches name, or null if its not found.
6870
       */
6871
      public static _Fields findByName(String name) {
6872
        return byName.get(name);
6873
      }
6874
 
6875
      private final short _thriftId;
6876
      private final String _fieldName;
6877
 
6878
      _Fields(short thriftId, String fieldName) {
6879
        _thriftId = thriftId;
6880
        _fieldName = fieldName;
6881
      }
6882
 
6883
      public short getThriftFieldId() {
6884
        return _thriftId;
6885
      }
6886
 
6887
      public String getFieldName() {
6888
        return _fieldName;
6889
      }
6890
    }
6891
 
6892
    // isset id assignments
6893
 
3430 rajveer 6894
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 6895
    static {
3430 rajveer 6896
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
6897
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6898
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
6899
      metaDataMap = Collections.unmodifiableMap(tmpMap);
6900
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSuccessfulPaymentCountForCoupon_args.class, metaDataMap);
3385 varun.gupt 6901
    }
6902
 
6903
    public getSuccessfulPaymentCountForCoupon_args() {
6904
    }
6905
 
6906
    public getSuccessfulPaymentCountForCoupon_args(
6907
      String couponCode)
6908
    {
6909
      this();
6910
      this.couponCode = couponCode;
6911
    }
6912
 
6913
    /**
6914
     * Performs a deep copy on <i>other</i>.
6915
     */
6916
    public getSuccessfulPaymentCountForCoupon_args(getSuccessfulPaymentCountForCoupon_args other) {
6917
      if (other.isSetCouponCode()) {
6918
        this.couponCode = other.couponCode;
6919
      }
6920
    }
6921
 
6922
    public getSuccessfulPaymentCountForCoupon_args deepCopy() {
6923
      return new getSuccessfulPaymentCountForCoupon_args(this);
6924
    }
6925
 
3430 rajveer 6926
    @Override
6927
    public void clear() {
6928
      this.couponCode = null;
3385 varun.gupt 6929
    }
6930
 
6931
    public String getCouponCode() {
6932
      return this.couponCode;
6933
    }
6934
 
3430 rajveer 6935
    public void setCouponCode(String couponCode) {
3385 varun.gupt 6936
      this.couponCode = couponCode;
6937
    }
6938
 
6939
    public void unsetCouponCode() {
6940
      this.couponCode = null;
6941
    }
6942
 
3430 rajveer 6943
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
3385 varun.gupt 6944
    public boolean isSetCouponCode() {
6945
      return this.couponCode != null;
6946
    }
6947
 
6948
    public void setCouponCodeIsSet(boolean value) {
6949
      if (!value) {
6950
        this.couponCode = null;
6951
      }
6952
    }
6953
 
6954
    public void setFieldValue(_Fields field, Object value) {
6955
      switch (field) {
6956
      case COUPON_CODE:
6957
        if (value == null) {
6958
          unsetCouponCode();
6959
        } else {
6960
          setCouponCode((String)value);
6961
        }
6962
        break;
6963
 
6964
      }
6965
    }
6966
 
6967
    public Object getFieldValue(_Fields field) {
6968
      switch (field) {
6969
      case COUPON_CODE:
6970
        return getCouponCode();
6971
 
6972
      }
6973
      throw new IllegalStateException();
6974
    }
6975
 
3430 rajveer 6976
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
6977
    public boolean isSet(_Fields field) {
6978
      if (field == null) {
6979
        throw new IllegalArgumentException();
6980
      }
3385 varun.gupt 6981
 
6982
      switch (field) {
6983
      case COUPON_CODE:
6984
        return isSetCouponCode();
6985
      }
6986
      throw new IllegalStateException();
6987
    }
6988
 
6989
    @Override
6990
    public boolean equals(Object that) {
6991
      if (that == null)
6992
        return false;
6993
      if (that instanceof getSuccessfulPaymentCountForCoupon_args)
6994
        return this.equals((getSuccessfulPaymentCountForCoupon_args)that);
6995
      return false;
6996
    }
6997
 
6998
    public boolean equals(getSuccessfulPaymentCountForCoupon_args that) {
6999
      if (that == null)
7000
        return false;
7001
 
7002
      boolean this_present_couponCode = true && this.isSetCouponCode();
7003
      boolean that_present_couponCode = true && that.isSetCouponCode();
7004
      if (this_present_couponCode || that_present_couponCode) {
7005
        if (!(this_present_couponCode && that_present_couponCode))
7006
          return false;
7007
        if (!this.couponCode.equals(that.couponCode))
7008
          return false;
7009
      }
7010
 
7011
      return true;
7012
    }
7013
 
7014
    @Override
7015
    public int hashCode() {
7016
      return 0;
7017
    }
7018
 
7019
    public int compareTo(getSuccessfulPaymentCountForCoupon_args other) {
7020
      if (!getClass().equals(other.getClass())) {
7021
        return getClass().getName().compareTo(other.getClass().getName());
7022
      }
7023
 
7024
      int lastComparison = 0;
7025
      getSuccessfulPaymentCountForCoupon_args typedOther = (getSuccessfulPaymentCountForCoupon_args)other;
7026
 
3430 rajveer 7027
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
3385 varun.gupt 7028
      if (lastComparison != 0) {
7029
        return lastComparison;
7030
      }
3430 rajveer 7031
      if (isSetCouponCode()) {
7032
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
7033
        if (lastComparison != 0) {
7034
          return lastComparison;
7035
        }
3385 varun.gupt 7036
      }
7037
      return 0;
7038
    }
7039
 
3430 rajveer 7040
    public _Fields fieldForId(int fieldId) {
7041
      return _Fields.findByThriftId(fieldId);
7042
    }
7043
 
7044
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
7045
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 7046
      iprot.readStructBegin();
7047
      while (true)
7048
      {
7049
        field = iprot.readFieldBegin();
3430 rajveer 7050
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 7051
          break;
7052
        }
3430 rajveer 7053
        switch (field.id) {
7054
          case 1: // COUPON_CODE
7055
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
7056
              this.couponCode = iprot.readString();
7057
            } else { 
7058
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7059
            }
7060
            break;
7061
          default:
7062
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 7063
        }
3430 rajveer 7064
        iprot.readFieldEnd();
3385 varun.gupt 7065
      }
7066
      iprot.readStructEnd();
7067
      validate();
7068
    }
7069
 
3430 rajveer 7070
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 7071
      validate();
7072
 
7073
      oprot.writeStructBegin(STRUCT_DESC);
7074
      if (this.couponCode != null) {
7075
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
7076
        oprot.writeString(this.couponCode);
7077
        oprot.writeFieldEnd();
7078
      }
7079
      oprot.writeFieldStop();
7080
      oprot.writeStructEnd();
7081
    }
7082
 
7083
    @Override
7084
    public String toString() {
7085
      StringBuilder sb = new StringBuilder("getSuccessfulPaymentCountForCoupon_args(");
7086
      boolean first = true;
7087
 
7088
      sb.append("couponCode:");
7089
      if (this.couponCode == null) {
7090
        sb.append("null");
7091
      } else {
7092
        sb.append(this.couponCode);
7093
      }
7094
      first = false;
7095
      sb.append(")");
7096
      return sb.toString();
7097
    }
7098
 
3430 rajveer 7099
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 7100
      // check for required fields
7101
    }
7102
 
3430 rajveer 7103
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
7104
      try {
7105
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
7106
      } catch (org.apache.thrift.TException te) {
7107
        throw new java.io.IOException(te);
7108
      }
7109
    }
7110
 
7111
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
7112
      try {
7113
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
7114
      } catch (org.apache.thrift.TException te) {
7115
        throw new java.io.IOException(te);
7116
      }
7117
    }
7118
 
3385 varun.gupt 7119
  }
7120
 
3430 rajveer 7121
  public static class getSuccessfulPaymentCountForCoupon_result implements org.apache.thrift.TBase<getSuccessfulPaymentCountForCoupon_result, getSuccessfulPaymentCountForCoupon_result._Fields>, java.io.Serializable, Cloneable   {
7122
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSuccessfulPaymentCountForCoupon_result");
3385 varun.gupt 7123
 
3430 rajveer 7124
    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);
7125
    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 7126
 
3430 rajveer 7127
    private long success; // required
7128
    private PromotionException pex; // required
3385 varun.gupt 7129
 
7130
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 7131
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 7132
      SUCCESS((short)0, "success"),
7133
      PEX((short)1, "pex");
7134
 
7135
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7136
 
7137
      static {
7138
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7139
          byName.put(field.getFieldName(), field);
7140
        }
7141
      }
7142
 
7143
      /**
7144
       * Find the _Fields constant that matches fieldId, or null if its not found.
7145
       */
7146
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 7147
        switch(fieldId) {
7148
          case 0: // SUCCESS
7149
            return SUCCESS;
7150
          case 1: // PEX
7151
            return PEX;
7152
          default:
7153
            return null;
7154
        }
3385 varun.gupt 7155
      }
7156
 
7157
      /**
7158
       * Find the _Fields constant that matches fieldId, throwing an exception
7159
       * if it is not found.
7160
       */
7161
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7162
        _Fields fields = findByThriftId(fieldId);
7163
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7164
        return fields;
7165
      }
7166
 
7167
      /**
7168
       * Find the _Fields constant that matches name, or null if its not found.
7169
       */
7170
      public static _Fields findByName(String name) {
7171
        return byName.get(name);
7172
      }
7173
 
7174
      private final short _thriftId;
7175
      private final String _fieldName;
7176
 
7177
      _Fields(short thriftId, String fieldName) {
7178
        _thriftId = thriftId;
7179
        _fieldName = fieldName;
7180
      }
7181
 
7182
      public short getThriftFieldId() {
7183
        return _thriftId;
7184
      }
7185
 
7186
      public String getFieldName() {
7187
        return _fieldName;
7188
      }
7189
    }
7190
 
7191
    // isset id assignments
7192
    private static final int __SUCCESS_ISSET_ID = 0;
7193
    private BitSet __isset_bit_vector = new BitSet(1);
7194
 
3430 rajveer 7195
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 7196
    static {
3430 rajveer 7197
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
7198
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7199
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
7200
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7201
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
7202
      metaDataMap = Collections.unmodifiableMap(tmpMap);
7203
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSuccessfulPaymentCountForCoupon_result.class, metaDataMap);
3385 varun.gupt 7204
    }
7205
 
7206
    public getSuccessfulPaymentCountForCoupon_result() {
7207
    }
7208
 
7209
    public getSuccessfulPaymentCountForCoupon_result(
7210
      long success,
7211
      PromotionException pex)
7212
    {
7213
      this();
7214
      this.success = success;
7215
      setSuccessIsSet(true);
7216
      this.pex = pex;
7217
    }
7218
 
7219
    /**
7220
     * Performs a deep copy on <i>other</i>.
7221
     */
7222
    public getSuccessfulPaymentCountForCoupon_result(getSuccessfulPaymentCountForCoupon_result other) {
7223
      __isset_bit_vector.clear();
7224
      __isset_bit_vector.or(other.__isset_bit_vector);
7225
      this.success = other.success;
7226
      if (other.isSetPex()) {
7227
        this.pex = new PromotionException(other.pex);
7228
      }
7229
    }
7230
 
7231
    public getSuccessfulPaymentCountForCoupon_result deepCopy() {
7232
      return new getSuccessfulPaymentCountForCoupon_result(this);
7233
    }
7234
 
3430 rajveer 7235
    @Override
7236
    public void clear() {
7237
      setSuccessIsSet(false);
7238
      this.success = 0;
7239
      this.pex = null;
3385 varun.gupt 7240
    }
7241
 
7242
    public long getSuccess() {
7243
      return this.success;
7244
    }
7245
 
3430 rajveer 7246
    public void setSuccess(long success) {
3385 varun.gupt 7247
      this.success = success;
7248
      setSuccessIsSet(true);
7249
    }
7250
 
7251
    public void unsetSuccess() {
7252
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
7253
    }
7254
 
3430 rajveer 7255
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3385 varun.gupt 7256
    public boolean isSetSuccess() {
7257
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
7258
    }
7259
 
7260
    public void setSuccessIsSet(boolean value) {
7261
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
7262
    }
7263
 
7264
    public PromotionException getPex() {
7265
      return this.pex;
7266
    }
7267
 
3430 rajveer 7268
    public void setPex(PromotionException pex) {
3385 varun.gupt 7269
      this.pex = pex;
7270
    }
7271
 
7272
    public void unsetPex() {
7273
      this.pex = null;
7274
    }
7275
 
3430 rajveer 7276
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
3385 varun.gupt 7277
    public boolean isSetPex() {
7278
      return this.pex != null;
7279
    }
7280
 
7281
    public void setPexIsSet(boolean value) {
7282
      if (!value) {
7283
        this.pex = null;
7284
      }
7285
    }
7286
 
7287
    public void setFieldValue(_Fields field, Object value) {
7288
      switch (field) {
7289
      case SUCCESS:
7290
        if (value == null) {
7291
          unsetSuccess();
7292
        } else {
7293
          setSuccess((Long)value);
7294
        }
7295
        break;
7296
 
7297
      case PEX:
7298
        if (value == null) {
7299
          unsetPex();
7300
        } else {
7301
          setPex((PromotionException)value);
7302
        }
7303
        break;
7304
 
7305
      }
7306
    }
7307
 
7308
    public Object getFieldValue(_Fields field) {
7309
      switch (field) {
7310
      case SUCCESS:
3430 rajveer 7311
        return Long.valueOf(getSuccess());
3385 varun.gupt 7312
 
7313
      case PEX:
7314
        return getPex();
7315
 
7316
      }
7317
      throw new IllegalStateException();
7318
    }
7319
 
3430 rajveer 7320
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
7321
    public boolean isSet(_Fields field) {
7322
      if (field == null) {
7323
        throw new IllegalArgumentException();
7324
      }
3385 varun.gupt 7325
 
7326
      switch (field) {
7327
      case SUCCESS:
7328
        return isSetSuccess();
7329
      case PEX:
7330
        return isSetPex();
7331
      }
7332
      throw new IllegalStateException();
7333
    }
7334
 
7335
    @Override
7336
    public boolean equals(Object that) {
7337
      if (that == null)
7338
        return false;
7339
      if (that instanceof getSuccessfulPaymentCountForCoupon_result)
7340
        return this.equals((getSuccessfulPaymentCountForCoupon_result)that);
7341
      return false;
7342
    }
7343
 
7344
    public boolean equals(getSuccessfulPaymentCountForCoupon_result that) {
7345
      if (that == null)
7346
        return false;
7347
 
7348
      boolean this_present_success = true;
7349
      boolean that_present_success = true;
7350
      if (this_present_success || that_present_success) {
7351
        if (!(this_present_success && that_present_success))
7352
          return false;
7353
        if (this.success != that.success)
7354
          return false;
7355
      }
7356
 
7357
      boolean this_present_pex = true && this.isSetPex();
7358
      boolean that_present_pex = true && that.isSetPex();
7359
      if (this_present_pex || that_present_pex) {
7360
        if (!(this_present_pex && that_present_pex))
7361
          return false;
7362
        if (!this.pex.equals(that.pex))
7363
          return false;
7364
      }
7365
 
7366
      return true;
7367
    }
7368
 
7369
    @Override
7370
    public int hashCode() {
7371
      return 0;
7372
    }
7373
 
7374
    public int compareTo(getSuccessfulPaymentCountForCoupon_result other) {
7375
      if (!getClass().equals(other.getClass())) {
7376
        return getClass().getName().compareTo(other.getClass().getName());
7377
      }
7378
 
7379
      int lastComparison = 0;
7380
      getSuccessfulPaymentCountForCoupon_result typedOther = (getSuccessfulPaymentCountForCoupon_result)other;
7381
 
3430 rajveer 7382
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3385 varun.gupt 7383
      if (lastComparison != 0) {
7384
        return lastComparison;
7385
      }
3430 rajveer 7386
      if (isSetSuccess()) {
7387
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
7388
        if (lastComparison != 0) {
7389
          return lastComparison;
7390
        }
3385 varun.gupt 7391
      }
3430 rajveer 7392
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
3385 varun.gupt 7393
      if (lastComparison != 0) {
7394
        return lastComparison;
7395
      }
3430 rajveer 7396
      if (isSetPex()) {
7397
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
7398
        if (lastComparison != 0) {
7399
          return lastComparison;
7400
        }
3385 varun.gupt 7401
      }
7402
      return 0;
7403
    }
7404
 
3430 rajveer 7405
    public _Fields fieldForId(int fieldId) {
7406
      return _Fields.findByThriftId(fieldId);
7407
    }
7408
 
7409
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
7410
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 7411
      iprot.readStructBegin();
7412
      while (true)
7413
      {
7414
        field = iprot.readFieldBegin();
3430 rajveer 7415
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 7416
          break;
7417
        }
3430 rajveer 7418
        switch (field.id) {
7419
          case 0: // SUCCESS
7420
            if (field.type == org.apache.thrift.protocol.TType.I64) {
7421
              this.success = iprot.readI64();
7422
              setSuccessIsSet(true);
7423
            } else { 
7424
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7425
            }
7426
            break;
7427
          case 1: // PEX
7428
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
7429
              this.pex = new PromotionException();
7430
              this.pex.read(iprot);
7431
            } else { 
7432
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7433
            }
7434
            break;
7435
          default:
7436
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 7437
        }
3430 rajveer 7438
        iprot.readFieldEnd();
3385 varun.gupt 7439
      }
7440
      iprot.readStructEnd();
7441
      validate();
7442
    }
7443
 
3430 rajveer 7444
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 7445
      oprot.writeStructBegin(STRUCT_DESC);
7446
 
7447
      if (this.isSetSuccess()) {
7448
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
7449
        oprot.writeI64(this.success);
7450
        oprot.writeFieldEnd();
7451
      } else if (this.isSetPex()) {
7452
        oprot.writeFieldBegin(PEX_FIELD_DESC);
7453
        this.pex.write(oprot);
7454
        oprot.writeFieldEnd();
7455
      }
7456
      oprot.writeFieldStop();
7457
      oprot.writeStructEnd();
7458
    }
7459
 
7460
    @Override
7461
    public String toString() {
7462
      StringBuilder sb = new StringBuilder("getSuccessfulPaymentCountForCoupon_result(");
7463
      boolean first = true;
7464
 
7465
      sb.append("success:");
7466
      sb.append(this.success);
7467
      first = false;
7468
      if (!first) sb.append(", ");
7469
      sb.append("pex:");
7470
      if (this.pex == null) {
7471
        sb.append("null");
7472
      } else {
7473
        sb.append(this.pex);
7474
      }
7475
      first = false;
7476
      sb.append(")");
7477
      return sb.toString();
7478
    }
7479
 
3430 rajveer 7480
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 7481
      // check for required fields
7482
    }
7483
 
3430 rajveer 7484
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
7485
      try {
7486
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
7487
      } catch (org.apache.thrift.TException te) {
7488
        throw new java.io.IOException(te);
7489
      }
7490
    }
7491
 
7492
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
7493
      try {
7494
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
7495
      } catch (org.apache.thrift.TException te) {
7496
        throw new java.io.IOException(te);
7497
      }
7498
    }
7499
 
3385 varun.gupt 7500
  }
7501
 
3430 rajveer 7502
  public static class getRuleDocString_args implements org.apache.thrift.TBase<getRuleDocString_args, getRuleDocString_args._Fields>, java.io.Serializable, Cloneable   {
7503
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRuleDocString_args");
3385 varun.gupt 7504
 
3430 rajveer 7505
    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 7506
 
3430 rajveer 7507
    private String ruleName; // required
3385 varun.gupt 7508
 
7509
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 7510
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 7511
      RULE_NAME((short)1, "ruleName");
7512
 
7513
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7514
 
7515
      static {
7516
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7517
          byName.put(field.getFieldName(), field);
7518
        }
7519
      }
7520
 
7521
      /**
7522
       * Find the _Fields constant that matches fieldId, or null if its not found.
7523
       */
7524
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 7525
        switch(fieldId) {
7526
          case 1: // RULE_NAME
7527
            return RULE_NAME;
7528
          default:
7529
            return null;
7530
        }
3385 varun.gupt 7531
      }
7532
 
7533
      /**
7534
       * Find the _Fields constant that matches fieldId, throwing an exception
7535
       * if it is not found.
7536
       */
7537
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7538
        _Fields fields = findByThriftId(fieldId);
7539
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7540
        return fields;
7541
      }
7542
 
7543
      /**
7544
       * Find the _Fields constant that matches name, or null if its not found.
7545
       */
7546
      public static _Fields findByName(String name) {
7547
        return byName.get(name);
7548
      }
7549
 
7550
      private final short _thriftId;
7551
      private final String _fieldName;
7552
 
7553
      _Fields(short thriftId, String fieldName) {
7554
        _thriftId = thriftId;
7555
        _fieldName = fieldName;
7556
      }
7557
 
7558
      public short getThriftFieldId() {
7559
        return _thriftId;
7560
      }
7561
 
7562
      public String getFieldName() {
7563
        return _fieldName;
7564
      }
7565
    }
7566
 
7567
    // isset id assignments
7568
 
3430 rajveer 7569
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 7570
    static {
3430 rajveer 7571
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
7572
      tmpMap.put(_Fields.RULE_NAME, new org.apache.thrift.meta_data.FieldMetaData("ruleName", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7573
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
7574
      metaDataMap = Collections.unmodifiableMap(tmpMap);
7575
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRuleDocString_args.class, metaDataMap);
3385 varun.gupt 7576
    }
7577
 
7578
    public getRuleDocString_args() {
7579
    }
7580
 
7581
    public getRuleDocString_args(
7582
      String ruleName)
7583
    {
7584
      this();
7585
      this.ruleName = ruleName;
7586
    }
7587
 
7588
    /**
7589
     * Performs a deep copy on <i>other</i>.
7590
     */
7591
    public getRuleDocString_args(getRuleDocString_args other) {
7592
      if (other.isSetRuleName()) {
7593
        this.ruleName = other.ruleName;
7594
      }
7595
    }
7596
 
7597
    public getRuleDocString_args deepCopy() {
7598
      return new getRuleDocString_args(this);
7599
    }
7600
 
3430 rajveer 7601
    @Override
7602
    public void clear() {
7603
      this.ruleName = null;
3385 varun.gupt 7604
    }
7605
 
7606
    public String getRuleName() {
7607
      return this.ruleName;
7608
    }
7609
 
3430 rajveer 7610
    public void setRuleName(String ruleName) {
3385 varun.gupt 7611
      this.ruleName = ruleName;
7612
    }
7613
 
7614
    public void unsetRuleName() {
7615
      this.ruleName = null;
7616
    }
7617
 
3430 rajveer 7618
    /** Returns true if field ruleName is set (has been assigned a value) and false otherwise */
3385 varun.gupt 7619
    public boolean isSetRuleName() {
7620
      return this.ruleName != null;
7621
    }
7622
 
7623
    public void setRuleNameIsSet(boolean value) {
7624
      if (!value) {
7625
        this.ruleName = null;
7626
      }
7627
    }
7628
 
7629
    public void setFieldValue(_Fields field, Object value) {
7630
      switch (field) {
7631
      case RULE_NAME:
7632
        if (value == null) {
7633
          unsetRuleName();
7634
        } else {
7635
          setRuleName((String)value);
7636
        }
7637
        break;
7638
 
7639
      }
7640
    }
7641
 
7642
    public Object getFieldValue(_Fields field) {
7643
      switch (field) {
7644
      case RULE_NAME:
7645
        return getRuleName();
7646
 
7647
      }
7648
      throw new IllegalStateException();
7649
    }
7650
 
3430 rajveer 7651
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
7652
    public boolean isSet(_Fields field) {
7653
      if (field == null) {
7654
        throw new IllegalArgumentException();
7655
      }
3385 varun.gupt 7656
 
7657
      switch (field) {
7658
      case RULE_NAME:
7659
        return isSetRuleName();
7660
      }
7661
      throw new IllegalStateException();
7662
    }
7663
 
7664
    @Override
7665
    public boolean equals(Object that) {
7666
      if (that == null)
7667
        return false;
7668
      if (that instanceof getRuleDocString_args)
7669
        return this.equals((getRuleDocString_args)that);
7670
      return false;
7671
    }
7672
 
7673
    public boolean equals(getRuleDocString_args that) {
7674
      if (that == null)
7675
        return false;
7676
 
7677
      boolean this_present_ruleName = true && this.isSetRuleName();
7678
      boolean that_present_ruleName = true && that.isSetRuleName();
7679
      if (this_present_ruleName || that_present_ruleName) {
7680
        if (!(this_present_ruleName && that_present_ruleName))
7681
          return false;
7682
        if (!this.ruleName.equals(that.ruleName))
7683
          return false;
7684
      }
7685
 
7686
      return true;
7687
    }
7688
 
7689
    @Override
7690
    public int hashCode() {
7691
      return 0;
7692
    }
7693
 
7694
    public int compareTo(getRuleDocString_args other) {
7695
      if (!getClass().equals(other.getClass())) {
7696
        return getClass().getName().compareTo(other.getClass().getName());
7697
      }
7698
 
7699
      int lastComparison = 0;
7700
      getRuleDocString_args typedOther = (getRuleDocString_args)other;
7701
 
3430 rajveer 7702
      lastComparison = Boolean.valueOf(isSetRuleName()).compareTo(typedOther.isSetRuleName());
3385 varun.gupt 7703
      if (lastComparison != 0) {
7704
        return lastComparison;
7705
      }
3430 rajveer 7706
      if (isSetRuleName()) {
7707
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ruleName, typedOther.ruleName);
7708
        if (lastComparison != 0) {
7709
          return lastComparison;
7710
        }
3385 varun.gupt 7711
      }
7712
      return 0;
7713
    }
7714
 
3430 rajveer 7715
    public _Fields fieldForId(int fieldId) {
7716
      return _Fields.findByThriftId(fieldId);
7717
    }
7718
 
7719
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
7720
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 7721
      iprot.readStructBegin();
7722
      while (true)
7723
      {
7724
        field = iprot.readFieldBegin();
3430 rajveer 7725
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 7726
          break;
7727
        }
3430 rajveer 7728
        switch (field.id) {
7729
          case 1: // RULE_NAME
7730
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
7731
              this.ruleName = iprot.readString();
7732
            } else { 
7733
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7734
            }
7735
            break;
7736
          default:
7737
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 7738
        }
3430 rajveer 7739
        iprot.readFieldEnd();
3385 varun.gupt 7740
      }
7741
      iprot.readStructEnd();
7742
      validate();
7743
    }
7744
 
3430 rajveer 7745
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 7746
      validate();
7747
 
7748
      oprot.writeStructBegin(STRUCT_DESC);
7749
      if (this.ruleName != null) {
7750
        oprot.writeFieldBegin(RULE_NAME_FIELD_DESC);
7751
        oprot.writeString(this.ruleName);
7752
        oprot.writeFieldEnd();
7753
      }
7754
      oprot.writeFieldStop();
7755
      oprot.writeStructEnd();
7756
    }
7757
 
7758
    @Override
7759
    public String toString() {
7760
      StringBuilder sb = new StringBuilder("getRuleDocString_args(");
7761
      boolean first = true;
7762
 
7763
      sb.append("ruleName:");
7764
      if (this.ruleName == null) {
7765
        sb.append("null");
7766
      } else {
7767
        sb.append(this.ruleName);
7768
      }
7769
      first = false;
7770
      sb.append(")");
7771
      return sb.toString();
7772
    }
7773
 
3430 rajveer 7774
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 7775
      // check for required fields
7776
    }
7777
 
3430 rajveer 7778
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
7779
      try {
7780
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
7781
      } catch (org.apache.thrift.TException te) {
7782
        throw new java.io.IOException(te);
7783
      }
7784
    }
7785
 
7786
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
7787
      try {
7788
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
7789
      } catch (org.apache.thrift.TException te) {
7790
        throw new java.io.IOException(te);
7791
      }
7792
    }
7793
 
3385 varun.gupt 7794
  }
7795
 
3430 rajveer 7796
  public static class getRuleDocString_result implements org.apache.thrift.TBase<getRuleDocString_result, getRuleDocString_result._Fields>, java.io.Serializable, Cloneable   {
7797
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRuleDocString_result");
3385 varun.gupt 7798
 
3430 rajveer 7799
    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 7800
 
3430 rajveer 7801
    private String success; // required
3385 varun.gupt 7802
 
7803
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 7804
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 7805
      SUCCESS((short)0, "success");
7806
 
7807
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7808
 
7809
      static {
7810
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7811
          byName.put(field.getFieldName(), field);
7812
        }
7813
      }
7814
 
7815
      /**
7816
       * Find the _Fields constant that matches fieldId, or null if its not found.
7817
       */
7818
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 7819
        switch(fieldId) {
7820
          case 0: // SUCCESS
7821
            return SUCCESS;
7822
          default:
7823
            return null;
7824
        }
3385 varun.gupt 7825
      }
7826
 
7827
      /**
7828
       * Find the _Fields constant that matches fieldId, throwing an exception
7829
       * if it is not found.
7830
       */
7831
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7832
        _Fields fields = findByThriftId(fieldId);
7833
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7834
        return fields;
7835
      }
7836
 
7837
      /**
7838
       * Find the _Fields constant that matches name, or null if its not found.
7839
       */
7840
      public static _Fields findByName(String name) {
7841
        return byName.get(name);
7842
      }
7843
 
7844
      private final short _thriftId;
7845
      private final String _fieldName;
7846
 
7847
      _Fields(short thriftId, String fieldName) {
7848
        _thriftId = thriftId;
7849
        _fieldName = fieldName;
7850
      }
7851
 
7852
      public short getThriftFieldId() {
7853
        return _thriftId;
7854
      }
7855
 
7856
      public String getFieldName() {
7857
        return _fieldName;
7858
      }
7859
    }
7860
 
7861
    // isset id assignments
7862
 
3430 rajveer 7863
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 7864
    static {
3430 rajveer 7865
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
7866
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7867
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
7868
      metaDataMap = Collections.unmodifiableMap(tmpMap);
7869
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRuleDocString_result.class, metaDataMap);
3385 varun.gupt 7870
    }
7871
 
7872
    public getRuleDocString_result() {
7873
    }
7874
 
7875
    public getRuleDocString_result(
7876
      String success)
7877
    {
7878
      this();
7879
      this.success = success;
7880
    }
7881
 
7882
    /**
7883
     * Performs a deep copy on <i>other</i>.
7884
     */
7885
    public getRuleDocString_result(getRuleDocString_result other) {
7886
      if (other.isSetSuccess()) {
7887
        this.success = other.success;
7888
      }
7889
    }
7890
 
7891
    public getRuleDocString_result deepCopy() {
7892
      return new getRuleDocString_result(this);
7893
    }
7894
 
3430 rajveer 7895
    @Override
7896
    public void clear() {
7897
      this.success = null;
3385 varun.gupt 7898
    }
7899
 
7900
    public String getSuccess() {
7901
      return this.success;
7902
    }
7903
 
3430 rajveer 7904
    public void setSuccess(String success) {
3385 varun.gupt 7905
      this.success = success;
7906
    }
7907
 
7908
    public void unsetSuccess() {
7909
      this.success = null;
7910
    }
7911
 
3430 rajveer 7912
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3385 varun.gupt 7913
    public boolean isSetSuccess() {
7914
      return this.success != null;
7915
    }
7916
 
7917
    public void setSuccessIsSet(boolean value) {
7918
      if (!value) {
7919
        this.success = null;
7920
      }
7921
    }
7922
 
7923
    public void setFieldValue(_Fields field, Object value) {
7924
      switch (field) {
7925
      case SUCCESS:
7926
        if (value == null) {
7927
          unsetSuccess();
7928
        } else {
7929
          setSuccess((String)value);
7930
        }
7931
        break;
7932
 
7933
      }
7934
    }
7935
 
7936
    public Object getFieldValue(_Fields field) {
7937
      switch (field) {
7938
      case SUCCESS:
7939
        return getSuccess();
7940
 
7941
      }
7942
      throw new IllegalStateException();
7943
    }
7944
 
3430 rajveer 7945
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
7946
    public boolean isSet(_Fields field) {
7947
      if (field == null) {
7948
        throw new IllegalArgumentException();
7949
      }
3385 varun.gupt 7950
 
7951
      switch (field) {
7952
      case SUCCESS:
7953
        return isSetSuccess();
7954
      }
7955
      throw new IllegalStateException();
7956
    }
7957
 
7958
    @Override
7959
    public boolean equals(Object that) {
7960
      if (that == null)
7961
        return false;
7962
      if (that instanceof getRuleDocString_result)
7963
        return this.equals((getRuleDocString_result)that);
7964
      return false;
7965
    }
7966
 
7967
    public boolean equals(getRuleDocString_result that) {
7968
      if (that == null)
7969
        return false;
7970
 
7971
      boolean this_present_success = true && this.isSetSuccess();
7972
      boolean that_present_success = true && that.isSetSuccess();
7973
      if (this_present_success || that_present_success) {
7974
        if (!(this_present_success && that_present_success))
7975
          return false;
7976
        if (!this.success.equals(that.success))
7977
          return false;
7978
      }
7979
 
7980
      return true;
7981
    }
7982
 
7983
    @Override
7984
    public int hashCode() {
7985
      return 0;
7986
    }
7987
 
7988
    public int compareTo(getRuleDocString_result other) {
7989
      if (!getClass().equals(other.getClass())) {
7990
        return getClass().getName().compareTo(other.getClass().getName());
7991
      }
7992
 
7993
      int lastComparison = 0;
7994
      getRuleDocString_result typedOther = (getRuleDocString_result)other;
7995
 
3430 rajveer 7996
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3385 varun.gupt 7997
      if (lastComparison != 0) {
7998
        return lastComparison;
7999
      }
3430 rajveer 8000
      if (isSetSuccess()) {
8001
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
8002
        if (lastComparison != 0) {
8003
          return lastComparison;
8004
        }
3385 varun.gupt 8005
      }
8006
      return 0;
8007
    }
8008
 
3430 rajveer 8009
    public _Fields fieldForId(int fieldId) {
8010
      return _Fields.findByThriftId(fieldId);
8011
    }
8012
 
8013
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
8014
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 8015
      iprot.readStructBegin();
8016
      while (true)
8017
      {
8018
        field = iprot.readFieldBegin();
3430 rajveer 8019
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 8020
          break;
8021
        }
3430 rajveer 8022
        switch (field.id) {
8023
          case 0: // SUCCESS
8024
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
8025
              this.success = iprot.readString();
8026
            } else { 
8027
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8028
            }
8029
            break;
8030
          default:
8031
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 8032
        }
3430 rajveer 8033
        iprot.readFieldEnd();
3385 varun.gupt 8034
      }
8035
      iprot.readStructEnd();
8036
      validate();
8037
    }
8038
 
3430 rajveer 8039
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 8040
      oprot.writeStructBegin(STRUCT_DESC);
8041
 
8042
      if (this.isSetSuccess()) {
8043
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
8044
        oprot.writeString(this.success);
8045
        oprot.writeFieldEnd();
8046
      }
8047
      oprot.writeFieldStop();
8048
      oprot.writeStructEnd();
8049
    }
8050
 
8051
    @Override
8052
    public String toString() {
8053
      StringBuilder sb = new StringBuilder("getRuleDocString_result(");
8054
      boolean first = true;
8055
 
8056
      sb.append("success:");
8057
      if (this.success == null) {
8058
        sb.append("null");
8059
      } else {
8060
        sb.append(this.success);
8061
      }
8062
      first = false;
8063
      sb.append(")");
8064
      return sb.toString();
8065
    }
8066
 
3430 rajveer 8067
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 8068
      // check for required fields
8069
    }
8070
 
3430 rajveer 8071
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
8072
      try {
8073
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
8074
      } catch (org.apache.thrift.TException te) {
8075
        throw new java.io.IOException(te);
8076
      }
8077
    }
8078
 
8079
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
8080
      try {
8081
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
8082
      } catch (org.apache.thrift.TException te) {
8083
        throw new java.io.IOException(te);
8084
      }
8085
    }
8086
 
3385 varun.gupt 8087
  }
8088
 
4189 varun.gupt 8089
  public static class getItemDiscountMap_args implements org.apache.thrift.TBase<getItemDiscountMap_args, getItemDiscountMap_args._Fields>, java.io.Serializable, Cloneable   {
8090
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemDiscountMap_args");
8091
 
8092
    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);
8093
 
8094
    private List<Long> itemIds; // required
8095
 
8096
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
8097
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
8098
      ITEM_IDS((short)1, "itemIds");
8099
 
8100
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8101
 
8102
      static {
8103
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8104
          byName.put(field.getFieldName(), field);
8105
        }
8106
      }
8107
 
8108
      /**
8109
       * Find the _Fields constant that matches fieldId, or null if its not found.
8110
       */
8111
      public static _Fields findByThriftId(int fieldId) {
8112
        switch(fieldId) {
8113
          case 1: // ITEM_IDS
8114
            return ITEM_IDS;
8115
          default:
8116
            return null;
8117
        }
8118
      }
8119
 
8120
      /**
8121
       * Find the _Fields constant that matches fieldId, throwing an exception
8122
       * if it is not found.
8123
       */
8124
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8125
        _Fields fields = findByThriftId(fieldId);
8126
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8127
        return fields;
8128
      }
8129
 
8130
      /**
8131
       * Find the _Fields constant that matches name, or null if its not found.
8132
       */
8133
      public static _Fields findByName(String name) {
8134
        return byName.get(name);
8135
      }
8136
 
8137
      private final short _thriftId;
8138
      private final String _fieldName;
8139
 
8140
      _Fields(short thriftId, String fieldName) {
8141
        _thriftId = thriftId;
8142
        _fieldName = fieldName;
8143
      }
8144
 
8145
      public short getThriftFieldId() {
8146
        return _thriftId;
8147
      }
8148
 
8149
      public String getFieldName() {
8150
        return _fieldName;
8151
      }
8152
    }
8153
 
8154
    // isset id assignments
8155
 
8156
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
8157
    static {
8158
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
8159
      tmpMap.put(_Fields.ITEM_IDS, new org.apache.thrift.meta_data.FieldMetaData("itemIds", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8160
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
8161
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))));
8162
      metaDataMap = Collections.unmodifiableMap(tmpMap);
8163
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getItemDiscountMap_args.class, metaDataMap);
8164
    }
8165
 
8166
    public getItemDiscountMap_args() {
8167
    }
8168
 
8169
    public getItemDiscountMap_args(
8170
      List<Long> itemIds)
8171
    {
8172
      this();
8173
      this.itemIds = itemIds;
8174
    }
8175
 
8176
    /**
8177
     * Performs a deep copy on <i>other</i>.
8178
     */
8179
    public getItemDiscountMap_args(getItemDiscountMap_args other) {
8180
      if (other.isSetItemIds()) {
8181
        List<Long> __this__itemIds = new ArrayList<Long>();
8182
        for (Long other_element : other.itemIds) {
8183
          __this__itemIds.add(other_element);
8184
        }
8185
        this.itemIds = __this__itemIds;
8186
      }
8187
    }
8188
 
8189
    public getItemDiscountMap_args deepCopy() {
8190
      return new getItemDiscountMap_args(this);
8191
    }
8192
 
8193
    @Override
8194
    public void clear() {
8195
      this.itemIds = null;
8196
    }
8197
 
8198
    public int getItemIdsSize() {
8199
      return (this.itemIds == null) ? 0 : this.itemIds.size();
8200
    }
8201
 
8202
    public java.util.Iterator<Long> getItemIdsIterator() {
8203
      return (this.itemIds == null) ? null : this.itemIds.iterator();
8204
    }
8205
 
8206
    public void addToItemIds(long elem) {
8207
      if (this.itemIds == null) {
8208
        this.itemIds = new ArrayList<Long>();
8209
      }
8210
      this.itemIds.add(elem);
8211
    }
8212
 
8213
    public List<Long> getItemIds() {
8214
      return this.itemIds;
8215
    }
8216
 
8217
    public void setItemIds(List<Long> itemIds) {
8218
      this.itemIds = itemIds;
8219
    }
8220
 
8221
    public void unsetItemIds() {
8222
      this.itemIds = null;
8223
    }
8224
 
8225
    /** Returns true if field itemIds is set (has been assigned a value) and false otherwise */
8226
    public boolean isSetItemIds() {
8227
      return this.itemIds != null;
8228
    }
8229
 
8230
    public void setItemIdsIsSet(boolean value) {
8231
      if (!value) {
8232
        this.itemIds = null;
8233
      }
8234
    }
8235
 
8236
    public void setFieldValue(_Fields field, Object value) {
8237
      switch (field) {
8238
      case ITEM_IDS:
8239
        if (value == null) {
8240
          unsetItemIds();
8241
        } else {
8242
          setItemIds((List<Long>)value);
8243
        }
8244
        break;
8245
 
8246
      }
8247
    }
8248
 
8249
    public Object getFieldValue(_Fields field) {
8250
      switch (field) {
8251
      case ITEM_IDS:
8252
        return getItemIds();
8253
 
8254
      }
8255
      throw new IllegalStateException();
8256
    }
8257
 
8258
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
8259
    public boolean isSet(_Fields field) {
8260
      if (field == null) {
8261
        throw new IllegalArgumentException();
8262
      }
8263
 
8264
      switch (field) {
8265
      case ITEM_IDS:
8266
        return isSetItemIds();
8267
      }
8268
      throw new IllegalStateException();
8269
    }
8270
 
8271
    @Override
8272
    public boolean equals(Object that) {
8273
      if (that == null)
8274
        return false;
8275
      if (that instanceof getItemDiscountMap_args)
8276
        return this.equals((getItemDiscountMap_args)that);
8277
      return false;
8278
    }
8279
 
8280
    public boolean equals(getItemDiscountMap_args that) {
8281
      if (that == null)
8282
        return false;
8283
 
8284
      boolean this_present_itemIds = true && this.isSetItemIds();
8285
      boolean that_present_itemIds = true && that.isSetItemIds();
8286
      if (this_present_itemIds || that_present_itemIds) {
8287
        if (!(this_present_itemIds && that_present_itemIds))
8288
          return false;
8289
        if (!this.itemIds.equals(that.itemIds))
8290
          return false;
8291
      }
8292
 
8293
      return true;
8294
    }
8295
 
8296
    @Override
8297
    public int hashCode() {
8298
      return 0;
8299
    }
8300
 
8301
    public int compareTo(getItemDiscountMap_args other) {
8302
      if (!getClass().equals(other.getClass())) {
8303
        return getClass().getName().compareTo(other.getClass().getName());
8304
      }
8305
 
8306
      int lastComparison = 0;
8307
      getItemDiscountMap_args typedOther = (getItemDiscountMap_args)other;
8308
 
8309
      lastComparison = Boolean.valueOf(isSetItemIds()).compareTo(typedOther.isSetItemIds());
8310
      if (lastComparison != 0) {
8311
        return lastComparison;
8312
      }
8313
      if (isSetItemIds()) {
8314
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.itemIds, typedOther.itemIds);
8315
        if (lastComparison != 0) {
8316
          return lastComparison;
8317
        }
8318
      }
8319
      return 0;
8320
    }
8321
 
8322
    public _Fields fieldForId(int fieldId) {
8323
      return _Fields.findByThriftId(fieldId);
8324
    }
8325
 
8326
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
8327
      org.apache.thrift.protocol.TField field;
8328
      iprot.readStructBegin();
8329
      while (true)
8330
      {
8331
        field = iprot.readFieldBegin();
8332
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
8333
          break;
8334
        }
8335
        switch (field.id) {
8336
          case 1: // ITEM_IDS
8337
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
8338
              {
5327 rajveer 8339
                org.apache.thrift.protocol.TList _list20 = iprot.readListBegin();
8340
                this.itemIds = new ArrayList<Long>(_list20.size);
8341
                for (int _i21 = 0; _i21 < _list20.size; ++_i21)
4189 varun.gupt 8342
                {
5327 rajveer 8343
                  long _elem22; // required
8344
                  _elem22 = iprot.readI64();
8345
                  this.itemIds.add(_elem22);
4189 varun.gupt 8346
                }
8347
                iprot.readListEnd();
8348
              }
8349
            } else { 
8350
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8351
            }
8352
            break;
8353
          default:
8354
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8355
        }
8356
        iprot.readFieldEnd();
8357
      }
8358
      iprot.readStructEnd();
8359
      validate();
8360
    }
8361
 
8362
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
8363
      validate();
8364
 
8365
      oprot.writeStructBegin(STRUCT_DESC);
8366
      if (this.itemIds != null) {
8367
        oprot.writeFieldBegin(ITEM_IDS_FIELD_DESC);
8368
        {
8369
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, this.itemIds.size()));
5327 rajveer 8370
          for (long _iter23 : this.itemIds)
4189 varun.gupt 8371
          {
5327 rajveer 8372
            oprot.writeI64(_iter23);
4189 varun.gupt 8373
          }
8374
          oprot.writeListEnd();
8375
        }
8376
        oprot.writeFieldEnd();
8377
      }
8378
      oprot.writeFieldStop();
8379
      oprot.writeStructEnd();
8380
    }
8381
 
8382
    @Override
8383
    public String toString() {
8384
      StringBuilder sb = new StringBuilder("getItemDiscountMap_args(");
8385
      boolean first = true;
8386
 
8387
      sb.append("itemIds:");
8388
      if (this.itemIds == null) {
8389
        sb.append("null");
8390
      } else {
8391
        sb.append(this.itemIds);
8392
      }
8393
      first = false;
8394
      sb.append(")");
8395
      return sb.toString();
8396
    }
8397
 
8398
    public void validate() throws org.apache.thrift.TException {
8399
      // check for required fields
8400
    }
8401
 
8402
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
8403
      try {
8404
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
8405
      } catch (org.apache.thrift.TException te) {
8406
        throw new java.io.IOException(te);
8407
      }
8408
    }
8409
 
8410
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
8411
      try {
8412
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
8413
      } catch (org.apache.thrift.TException te) {
8414
        throw new java.io.IOException(te);
8415
      }
8416
    }
8417
 
8418
  }
8419
 
8420
  public static class getItemDiscountMap_result implements org.apache.thrift.TBase<getItemDiscountMap_result, getItemDiscountMap_result._Fields>, java.io.Serializable, Cloneable   {
8421
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemDiscountMap_result");
8422
 
8423
    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);
8424
    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);
8425
 
8426
    private List<ItemCouponDiscount> success; // required
8427
    private PromotionException pex; // required
8428
 
8429
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
8430
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
8431
      SUCCESS((short)0, "success"),
8432
      PEX((short)1, "pex");
8433
 
8434
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8435
 
8436
      static {
8437
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8438
          byName.put(field.getFieldName(), field);
8439
        }
8440
      }
8441
 
8442
      /**
8443
       * Find the _Fields constant that matches fieldId, or null if its not found.
8444
       */
8445
      public static _Fields findByThriftId(int fieldId) {
8446
        switch(fieldId) {
8447
          case 0: // SUCCESS
8448
            return SUCCESS;
8449
          case 1: // PEX
8450
            return PEX;
8451
          default:
8452
            return null;
8453
        }
8454
      }
8455
 
8456
      /**
8457
       * Find the _Fields constant that matches fieldId, throwing an exception
8458
       * if it is not found.
8459
       */
8460
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8461
        _Fields fields = findByThriftId(fieldId);
8462
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8463
        return fields;
8464
      }
8465
 
8466
      /**
8467
       * Find the _Fields constant that matches name, or null if its not found.
8468
       */
8469
      public static _Fields findByName(String name) {
8470
        return byName.get(name);
8471
      }
8472
 
8473
      private final short _thriftId;
8474
      private final String _fieldName;
8475
 
8476
      _Fields(short thriftId, String fieldName) {
8477
        _thriftId = thriftId;
8478
        _fieldName = fieldName;
8479
      }
8480
 
8481
      public short getThriftFieldId() {
8482
        return _thriftId;
8483
      }
8484
 
8485
      public String getFieldName() {
8486
        return _fieldName;
8487
      }
8488
    }
8489
 
8490
    // isset id assignments
8491
 
8492
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
8493
    static {
8494
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
8495
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8496
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
8497
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ItemCouponDiscount.class))));
8498
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8499
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
8500
      metaDataMap = Collections.unmodifiableMap(tmpMap);
8501
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getItemDiscountMap_result.class, metaDataMap);
8502
    }
8503
 
8504
    public getItemDiscountMap_result() {
8505
    }
8506
 
8507
    public getItemDiscountMap_result(
8508
      List<ItemCouponDiscount> success,
8509
      PromotionException pex)
8510
    {
8511
      this();
8512
      this.success = success;
8513
      this.pex = pex;
8514
    }
8515
 
8516
    /**
8517
     * Performs a deep copy on <i>other</i>.
8518
     */
8519
    public getItemDiscountMap_result(getItemDiscountMap_result other) {
8520
      if (other.isSetSuccess()) {
8521
        List<ItemCouponDiscount> __this__success = new ArrayList<ItemCouponDiscount>();
8522
        for (ItemCouponDiscount other_element : other.success) {
8523
          __this__success.add(new ItemCouponDiscount(other_element));
8524
        }
8525
        this.success = __this__success;
8526
      }
8527
      if (other.isSetPex()) {
8528
        this.pex = new PromotionException(other.pex);
8529
      }
8530
    }
8531
 
8532
    public getItemDiscountMap_result deepCopy() {
8533
      return new getItemDiscountMap_result(this);
8534
    }
8535
 
8536
    @Override
8537
    public void clear() {
8538
      this.success = null;
8539
      this.pex = null;
8540
    }
8541
 
8542
    public int getSuccessSize() {
8543
      return (this.success == null) ? 0 : this.success.size();
8544
    }
8545
 
8546
    public java.util.Iterator<ItemCouponDiscount> getSuccessIterator() {
8547
      return (this.success == null) ? null : this.success.iterator();
8548
    }
8549
 
8550
    public void addToSuccess(ItemCouponDiscount elem) {
8551
      if (this.success == null) {
8552
        this.success = new ArrayList<ItemCouponDiscount>();
8553
      }
8554
      this.success.add(elem);
8555
    }
8556
 
8557
    public List<ItemCouponDiscount> getSuccess() {
8558
      return this.success;
8559
    }
8560
 
8561
    public void setSuccess(List<ItemCouponDiscount> success) {
8562
      this.success = success;
8563
    }
8564
 
8565
    public void unsetSuccess() {
8566
      this.success = null;
8567
    }
8568
 
8569
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
8570
    public boolean isSetSuccess() {
8571
      return this.success != null;
8572
    }
8573
 
8574
    public void setSuccessIsSet(boolean value) {
8575
      if (!value) {
8576
        this.success = null;
8577
      }
8578
    }
8579
 
8580
    public PromotionException getPex() {
8581
      return this.pex;
8582
    }
8583
 
8584
    public void setPex(PromotionException pex) {
8585
      this.pex = pex;
8586
    }
8587
 
8588
    public void unsetPex() {
8589
      this.pex = null;
8590
    }
8591
 
8592
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
8593
    public boolean isSetPex() {
8594
      return this.pex != null;
8595
    }
8596
 
8597
    public void setPexIsSet(boolean value) {
8598
      if (!value) {
8599
        this.pex = null;
8600
      }
8601
    }
8602
 
8603
    public void setFieldValue(_Fields field, Object value) {
8604
      switch (field) {
8605
      case SUCCESS:
8606
        if (value == null) {
8607
          unsetSuccess();
8608
        } else {
8609
          setSuccess((List<ItemCouponDiscount>)value);
8610
        }
8611
        break;
8612
 
8613
      case PEX:
8614
        if (value == null) {
8615
          unsetPex();
8616
        } else {
8617
          setPex((PromotionException)value);
8618
        }
8619
        break;
8620
 
8621
      }
8622
    }
8623
 
8624
    public Object getFieldValue(_Fields field) {
8625
      switch (field) {
8626
      case SUCCESS:
8627
        return getSuccess();
8628
 
8629
      case PEX:
8630
        return getPex();
8631
 
8632
      }
8633
      throw new IllegalStateException();
8634
    }
8635
 
8636
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
8637
    public boolean isSet(_Fields field) {
8638
      if (field == null) {
8639
        throw new IllegalArgumentException();
8640
      }
8641
 
8642
      switch (field) {
8643
      case SUCCESS:
8644
        return isSetSuccess();
8645
      case PEX:
8646
        return isSetPex();
8647
      }
8648
      throw new IllegalStateException();
8649
    }
8650
 
8651
    @Override
8652
    public boolean equals(Object that) {
8653
      if (that == null)
8654
        return false;
8655
      if (that instanceof getItemDiscountMap_result)
8656
        return this.equals((getItemDiscountMap_result)that);
8657
      return false;
8658
    }
8659
 
8660
    public boolean equals(getItemDiscountMap_result that) {
8661
      if (that == null)
8662
        return false;
8663
 
8664
      boolean this_present_success = true && this.isSetSuccess();
8665
      boolean that_present_success = true && that.isSetSuccess();
8666
      if (this_present_success || that_present_success) {
8667
        if (!(this_present_success && that_present_success))
8668
          return false;
8669
        if (!this.success.equals(that.success))
8670
          return false;
8671
      }
8672
 
8673
      boolean this_present_pex = true && this.isSetPex();
8674
      boolean that_present_pex = true && that.isSetPex();
8675
      if (this_present_pex || that_present_pex) {
8676
        if (!(this_present_pex && that_present_pex))
8677
          return false;
8678
        if (!this.pex.equals(that.pex))
8679
          return false;
8680
      }
8681
 
8682
      return true;
8683
    }
8684
 
8685
    @Override
8686
    public int hashCode() {
8687
      return 0;
8688
    }
8689
 
8690
    public int compareTo(getItemDiscountMap_result other) {
8691
      if (!getClass().equals(other.getClass())) {
8692
        return getClass().getName().compareTo(other.getClass().getName());
8693
      }
8694
 
8695
      int lastComparison = 0;
8696
      getItemDiscountMap_result typedOther = (getItemDiscountMap_result)other;
8697
 
8698
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
8699
      if (lastComparison != 0) {
8700
        return lastComparison;
8701
      }
8702
      if (isSetSuccess()) {
8703
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
8704
        if (lastComparison != 0) {
8705
          return lastComparison;
8706
        }
8707
      }
8708
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
8709
      if (lastComparison != 0) {
8710
        return lastComparison;
8711
      }
8712
      if (isSetPex()) {
8713
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
8714
        if (lastComparison != 0) {
8715
          return lastComparison;
8716
        }
8717
      }
8718
      return 0;
8719
    }
8720
 
8721
    public _Fields fieldForId(int fieldId) {
8722
      return _Fields.findByThriftId(fieldId);
8723
    }
8724
 
8725
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
8726
      org.apache.thrift.protocol.TField field;
8727
      iprot.readStructBegin();
8728
      while (true)
8729
      {
8730
        field = iprot.readFieldBegin();
8731
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
8732
          break;
8733
        }
8734
        switch (field.id) {
8735
          case 0: // SUCCESS
8736
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
8737
              {
5327 rajveer 8738
                org.apache.thrift.protocol.TList _list24 = iprot.readListBegin();
8739
                this.success = new ArrayList<ItemCouponDiscount>(_list24.size);
8740
                for (int _i25 = 0; _i25 < _list24.size; ++_i25)
4189 varun.gupt 8741
                {
5327 rajveer 8742
                  ItemCouponDiscount _elem26; // required
8743
                  _elem26 = new ItemCouponDiscount();
8744
                  _elem26.read(iprot);
8745
                  this.success.add(_elem26);
4189 varun.gupt 8746
                }
8747
                iprot.readListEnd();
8748
              }
8749
            } else { 
8750
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8751
            }
8752
            break;
8753
          case 1: // PEX
8754
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
8755
              this.pex = new PromotionException();
8756
              this.pex.read(iprot);
8757
            } else { 
8758
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8759
            }
8760
            break;
8761
          default:
8762
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8763
        }
8764
        iprot.readFieldEnd();
8765
      }
8766
      iprot.readStructEnd();
8767
      validate();
8768
    }
8769
 
8770
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
8771
      oprot.writeStructBegin(STRUCT_DESC);
8772
 
8773
      if (this.isSetSuccess()) {
8774
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
8775
        {
8776
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
5327 rajveer 8777
          for (ItemCouponDiscount _iter27 : this.success)
4189 varun.gupt 8778
          {
5327 rajveer 8779
            _iter27.write(oprot);
4189 varun.gupt 8780
          }
8781
          oprot.writeListEnd();
8782
        }
8783
        oprot.writeFieldEnd();
8784
      } else if (this.isSetPex()) {
8785
        oprot.writeFieldBegin(PEX_FIELD_DESC);
8786
        this.pex.write(oprot);
8787
        oprot.writeFieldEnd();
8788
      }
8789
      oprot.writeFieldStop();
8790
      oprot.writeStructEnd();
8791
    }
8792
 
8793
    @Override
8794
    public String toString() {
8795
      StringBuilder sb = new StringBuilder("getItemDiscountMap_result(");
8796
      boolean first = true;
8797
 
8798
      sb.append("success:");
8799
      if (this.success == null) {
8800
        sb.append("null");
8801
      } else {
8802
        sb.append(this.success);
8803
      }
8804
      first = false;
8805
      if (!first) sb.append(", ");
8806
      sb.append("pex:");
8807
      if (this.pex == null) {
8808
        sb.append("null");
8809
      } else {
8810
        sb.append(this.pex);
8811
      }
8812
      first = false;
8813
      sb.append(")");
8814
      return sb.toString();
8815
    }
8816
 
8817
    public void validate() throws org.apache.thrift.TException {
8818
      // check for required fields
8819
    }
8820
 
8821
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
8822
      try {
8823
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
8824
      } catch (org.apache.thrift.TException te) {
8825
        throw new java.io.IOException(te);
8826
      }
8827
    }
8828
 
8829
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
8830
      try {
8831
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
8832
      } catch (org.apache.thrift.TException te) {
8833
        throw new java.io.IOException(te);
8834
      }
8835
    }
8836
 
8837
  }
8838
 
4494 varun.gupt 8839
  public static class getDiscountsForEntity_args implements org.apache.thrift.TBase<getDiscountsForEntity_args, getDiscountsForEntity_args._Fields>, java.io.Serializable, Cloneable   {
8840
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getDiscountsForEntity_args");
8841
 
8842
    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);
8843
 
8844
    private long entityId; // required
8845
 
8846
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
8847
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
8848
      ENTITY_ID((short)1, "entityId");
8849
 
8850
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8851
 
8852
      static {
8853
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8854
          byName.put(field.getFieldName(), field);
8855
        }
8856
      }
8857
 
8858
      /**
8859
       * Find the _Fields constant that matches fieldId, or null if its not found.
8860
       */
8861
      public static _Fields findByThriftId(int fieldId) {
8862
        switch(fieldId) {
8863
          case 1: // ENTITY_ID
8864
            return ENTITY_ID;
8865
          default:
8866
            return null;
8867
        }
8868
      }
8869
 
8870
      /**
8871
       * Find the _Fields constant that matches fieldId, throwing an exception
8872
       * if it is not found.
8873
       */
8874
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8875
        _Fields fields = findByThriftId(fieldId);
8876
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8877
        return fields;
8878
      }
8879
 
8880
      /**
8881
       * Find the _Fields constant that matches name, or null if its not found.
8882
       */
8883
      public static _Fields findByName(String name) {
8884
        return byName.get(name);
8885
      }
8886
 
8887
      private final short _thriftId;
8888
      private final String _fieldName;
8889
 
8890
      _Fields(short thriftId, String fieldName) {
8891
        _thriftId = thriftId;
8892
        _fieldName = fieldName;
8893
      }
8894
 
8895
      public short getThriftFieldId() {
8896
        return _thriftId;
8897
      }
8898
 
8899
      public String getFieldName() {
8900
        return _fieldName;
8901
      }
8902
    }
8903
 
8904
    // isset id assignments
8905
    private static final int __ENTITYID_ISSET_ID = 0;
8906
    private BitSet __isset_bit_vector = new BitSet(1);
8907
 
8908
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
8909
    static {
8910
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
8911
      tmpMap.put(_Fields.ENTITY_ID, new org.apache.thrift.meta_data.FieldMetaData("entityId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8912
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
8913
      metaDataMap = Collections.unmodifiableMap(tmpMap);
8914
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getDiscountsForEntity_args.class, metaDataMap);
8915
    }
8916
 
8917
    public getDiscountsForEntity_args() {
8918
    }
8919
 
8920
    public getDiscountsForEntity_args(
8921
      long entityId)
8922
    {
8923
      this();
8924
      this.entityId = entityId;
8925
      setEntityIdIsSet(true);
8926
    }
8927
 
8928
    /**
8929
     * Performs a deep copy on <i>other</i>.
8930
     */
8931
    public getDiscountsForEntity_args(getDiscountsForEntity_args other) {
8932
      __isset_bit_vector.clear();
8933
      __isset_bit_vector.or(other.__isset_bit_vector);
8934
      this.entityId = other.entityId;
8935
    }
8936
 
8937
    public getDiscountsForEntity_args deepCopy() {
8938
      return new getDiscountsForEntity_args(this);
8939
    }
8940
 
8941
    @Override
8942
    public void clear() {
8943
      setEntityIdIsSet(false);
8944
      this.entityId = 0;
8945
    }
8946
 
8947
    public long getEntityId() {
8948
      return this.entityId;
8949
    }
8950
 
8951
    public void setEntityId(long entityId) {
8952
      this.entityId = entityId;
8953
      setEntityIdIsSet(true);
8954
    }
8955
 
8956
    public void unsetEntityId() {
8957
      __isset_bit_vector.clear(__ENTITYID_ISSET_ID);
8958
    }
8959
 
8960
    /** Returns true if field entityId is set (has been assigned a value) and false otherwise */
8961
    public boolean isSetEntityId() {
8962
      return __isset_bit_vector.get(__ENTITYID_ISSET_ID);
8963
    }
8964
 
8965
    public void setEntityIdIsSet(boolean value) {
8966
      __isset_bit_vector.set(__ENTITYID_ISSET_ID, value);
8967
    }
8968
 
8969
    public void setFieldValue(_Fields field, Object value) {
8970
      switch (field) {
8971
      case ENTITY_ID:
8972
        if (value == null) {
8973
          unsetEntityId();
8974
        } else {
8975
          setEntityId((Long)value);
8976
        }
8977
        break;
8978
 
8979
      }
8980
    }
8981
 
8982
    public Object getFieldValue(_Fields field) {
8983
      switch (field) {
8984
      case ENTITY_ID:
8985
        return Long.valueOf(getEntityId());
8986
 
8987
      }
8988
      throw new IllegalStateException();
8989
    }
8990
 
8991
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
8992
    public boolean isSet(_Fields field) {
8993
      if (field == null) {
8994
        throw new IllegalArgumentException();
8995
      }
8996
 
8997
      switch (field) {
8998
      case ENTITY_ID:
8999
        return isSetEntityId();
9000
      }
9001
      throw new IllegalStateException();
9002
    }
9003
 
9004
    @Override
9005
    public boolean equals(Object that) {
9006
      if (that == null)
9007
        return false;
9008
      if (that instanceof getDiscountsForEntity_args)
9009
        return this.equals((getDiscountsForEntity_args)that);
9010
      return false;
9011
    }
9012
 
9013
    public boolean equals(getDiscountsForEntity_args that) {
9014
      if (that == null)
9015
        return false;
9016
 
9017
      boolean this_present_entityId = true;
9018
      boolean that_present_entityId = true;
9019
      if (this_present_entityId || that_present_entityId) {
9020
        if (!(this_present_entityId && that_present_entityId))
9021
          return false;
9022
        if (this.entityId != that.entityId)
9023
          return false;
9024
      }
9025
 
9026
      return true;
9027
    }
9028
 
9029
    @Override
9030
    public int hashCode() {
9031
      return 0;
9032
    }
9033
 
9034
    public int compareTo(getDiscountsForEntity_args other) {
9035
      if (!getClass().equals(other.getClass())) {
9036
        return getClass().getName().compareTo(other.getClass().getName());
9037
      }
9038
 
9039
      int lastComparison = 0;
9040
      getDiscountsForEntity_args typedOther = (getDiscountsForEntity_args)other;
9041
 
9042
      lastComparison = Boolean.valueOf(isSetEntityId()).compareTo(typedOther.isSetEntityId());
9043
      if (lastComparison != 0) {
9044
        return lastComparison;
9045
      }
9046
      if (isSetEntityId()) {
9047
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityId, typedOther.entityId);
9048
        if (lastComparison != 0) {
9049
          return lastComparison;
9050
        }
9051
      }
9052
      return 0;
9053
    }
9054
 
9055
    public _Fields fieldForId(int fieldId) {
9056
      return _Fields.findByThriftId(fieldId);
9057
    }
9058
 
9059
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
9060
      org.apache.thrift.protocol.TField field;
9061
      iprot.readStructBegin();
9062
      while (true)
9063
      {
9064
        field = iprot.readFieldBegin();
9065
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
9066
          break;
9067
        }
9068
        switch (field.id) {
9069
          case 1: // ENTITY_ID
9070
            if (field.type == org.apache.thrift.protocol.TType.I64) {
9071
              this.entityId = iprot.readI64();
9072
              setEntityIdIsSet(true);
9073
            } else { 
9074
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9075
            }
9076
            break;
9077
          default:
9078
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9079
        }
9080
        iprot.readFieldEnd();
9081
      }
9082
      iprot.readStructEnd();
9083
      validate();
9084
    }
9085
 
9086
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
9087
      validate();
9088
 
9089
      oprot.writeStructBegin(STRUCT_DESC);
9090
      oprot.writeFieldBegin(ENTITY_ID_FIELD_DESC);
9091
      oprot.writeI64(this.entityId);
9092
      oprot.writeFieldEnd();
9093
      oprot.writeFieldStop();
9094
      oprot.writeStructEnd();
9095
    }
9096
 
9097
    @Override
9098
    public String toString() {
9099
      StringBuilder sb = new StringBuilder("getDiscountsForEntity_args(");
9100
      boolean first = true;
9101
 
9102
      sb.append("entityId:");
9103
      sb.append(this.entityId);
9104
      first = false;
9105
      sb.append(")");
9106
      return sb.toString();
9107
    }
9108
 
9109
    public void validate() throws org.apache.thrift.TException {
9110
      // check for required fields
9111
    }
9112
 
9113
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
9114
      try {
9115
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
9116
      } catch (org.apache.thrift.TException te) {
9117
        throw new java.io.IOException(te);
9118
      }
9119
    }
9120
 
9121
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
9122
      try {
9123
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
9124
        __isset_bit_vector = new BitSet(1);
9125
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
9126
      } catch (org.apache.thrift.TException te) {
9127
        throw new java.io.IOException(te);
9128
      }
9129
    }
9130
 
9131
  }
9132
 
9133
  public static class getDiscountsForEntity_result implements org.apache.thrift.TBase<getDiscountsForEntity_result, getDiscountsForEntity_result._Fields>, java.io.Serializable, Cloneable   {
9134
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getDiscountsForEntity_result");
9135
 
9136
    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);
9137
 
9138
    private Map<String,Double> success; // required
9139
 
9140
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
9141
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
9142
      SUCCESS((short)0, "success");
9143
 
9144
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
9145
 
9146
      static {
9147
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
9148
          byName.put(field.getFieldName(), field);
9149
        }
9150
      }
9151
 
9152
      /**
9153
       * Find the _Fields constant that matches fieldId, or null if its not found.
9154
       */
9155
      public static _Fields findByThriftId(int fieldId) {
9156
        switch(fieldId) {
9157
          case 0: // SUCCESS
9158
            return SUCCESS;
9159
          default:
9160
            return null;
9161
        }
9162
      }
9163
 
9164
      /**
9165
       * Find the _Fields constant that matches fieldId, throwing an exception
9166
       * if it is not found.
9167
       */
9168
      public static _Fields findByThriftIdOrThrow(int fieldId) {
9169
        _Fields fields = findByThriftId(fieldId);
9170
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
9171
        return fields;
9172
      }
9173
 
9174
      /**
9175
       * Find the _Fields constant that matches name, or null if its not found.
9176
       */
9177
      public static _Fields findByName(String name) {
9178
        return byName.get(name);
9179
      }
9180
 
9181
      private final short _thriftId;
9182
      private final String _fieldName;
9183
 
9184
      _Fields(short thriftId, String fieldName) {
9185
        _thriftId = thriftId;
9186
        _fieldName = fieldName;
9187
      }
9188
 
9189
      public short getThriftFieldId() {
9190
        return _thriftId;
9191
      }
9192
 
9193
      public String getFieldName() {
9194
        return _fieldName;
9195
      }
9196
    }
9197
 
9198
    // isset id assignments
9199
 
9200
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
9201
    static {
9202
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
9203
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9204
          new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
9205
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), 
9206
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))));
9207
      metaDataMap = Collections.unmodifiableMap(tmpMap);
9208
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getDiscountsForEntity_result.class, metaDataMap);
9209
    }
9210
 
9211
    public getDiscountsForEntity_result() {
9212
    }
9213
 
9214
    public getDiscountsForEntity_result(
9215
      Map<String,Double> success)
9216
    {
9217
      this();
9218
      this.success = success;
9219
    }
9220
 
9221
    /**
9222
     * Performs a deep copy on <i>other</i>.
9223
     */
9224
    public getDiscountsForEntity_result(getDiscountsForEntity_result other) {
9225
      if (other.isSetSuccess()) {
9226
        Map<String,Double> __this__success = new HashMap<String,Double>();
9227
        for (Map.Entry<String, Double> other_element : other.success.entrySet()) {
9228
 
9229
          String other_element_key = other_element.getKey();
9230
          Double other_element_value = other_element.getValue();
9231
 
9232
          String __this__success_copy_key = other_element_key;
9233
 
9234
          Double __this__success_copy_value = other_element_value;
9235
 
9236
          __this__success.put(__this__success_copy_key, __this__success_copy_value);
9237
        }
9238
        this.success = __this__success;
9239
      }
9240
    }
9241
 
9242
    public getDiscountsForEntity_result deepCopy() {
9243
      return new getDiscountsForEntity_result(this);
9244
    }
9245
 
9246
    @Override
9247
    public void clear() {
9248
      this.success = null;
9249
    }
9250
 
9251
    public int getSuccessSize() {
9252
      return (this.success == null) ? 0 : this.success.size();
9253
    }
9254
 
9255
    public void putToSuccess(String key, double val) {
9256
      if (this.success == null) {
9257
        this.success = new HashMap<String,Double>();
9258
      }
9259
      this.success.put(key, val);
9260
    }
9261
 
9262
    public Map<String,Double> getSuccess() {
9263
      return this.success;
9264
    }
9265
 
9266
    public void setSuccess(Map<String,Double> success) {
9267
      this.success = success;
9268
    }
9269
 
9270
    public void unsetSuccess() {
9271
      this.success = null;
9272
    }
9273
 
9274
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
9275
    public boolean isSetSuccess() {
9276
      return this.success != null;
9277
    }
9278
 
9279
    public void setSuccessIsSet(boolean value) {
9280
      if (!value) {
9281
        this.success = null;
9282
      }
9283
    }
9284
 
9285
    public void setFieldValue(_Fields field, Object value) {
9286
      switch (field) {
9287
      case SUCCESS:
9288
        if (value == null) {
9289
          unsetSuccess();
9290
        } else {
9291
          setSuccess((Map<String,Double>)value);
9292
        }
9293
        break;
9294
 
9295
      }
9296
    }
9297
 
9298
    public Object getFieldValue(_Fields field) {
9299
      switch (field) {
9300
      case SUCCESS:
9301
        return getSuccess();
9302
 
9303
      }
9304
      throw new IllegalStateException();
9305
    }
9306
 
9307
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
9308
    public boolean isSet(_Fields field) {
9309
      if (field == null) {
9310
        throw new IllegalArgumentException();
9311
      }
9312
 
9313
      switch (field) {
9314
      case SUCCESS:
9315
        return isSetSuccess();
9316
      }
9317
      throw new IllegalStateException();
9318
    }
9319
 
9320
    @Override
9321
    public boolean equals(Object that) {
9322
      if (that == null)
9323
        return false;
9324
      if (that instanceof getDiscountsForEntity_result)
9325
        return this.equals((getDiscountsForEntity_result)that);
9326
      return false;
9327
    }
9328
 
9329
    public boolean equals(getDiscountsForEntity_result that) {
9330
      if (that == null)
9331
        return false;
9332
 
9333
      boolean this_present_success = true && this.isSetSuccess();
9334
      boolean that_present_success = true && that.isSetSuccess();
9335
      if (this_present_success || that_present_success) {
9336
        if (!(this_present_success && that_present_success))
9337
          return false;
9338
        if (!this.success.equals(that.success))
9339
          return false;
9340
      }
9341
 
9342
      return true;
9343
    }
9344
 
9345
    @Override
9346
    public int hashCode() {
9347
      return 0;
9348
    }
9349
 
9350
    public int compareTo(getDiscountsForEntity_result other) {
9351
      if (!getClass().equals(other.getClass())) {
9352
        return getClass().getName().compareTo(other.getClass().getName());
9353
      }
9354
 
9355
      int lastComparison = 0;
9356
      getDiscountsForEntity_result typedOther = (getDiscountsForEntity_result)other;
9357
 
9358
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
9359
      if (lastComparison != 0) {
9360
        return lastComparison;
9361
      }
9362
      if (isSetSuccess()) {
9363
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
9364
        if (lastComparison != 0) {
9365
          return lastComparison;
9366
        }
9367
      }
9368
      return 0;
9369
    }
9370
 
9371
    public _Fields fieldForId(int fieldId) {
9372
      return _Fields.findByThriftId(fieldId);
9373
    }
9374
 
9375
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
9376
      org.apache.thrift.protocol.TField field;
9377
      iprot.readStructBegin();
9378
      while (true)
9379
      {
9380
        field = iprot.readFieldBegin();
9381
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
9382
          break;
9383
        }
9384
        switch (field.id) {
9385
          case 0: // SUCCESS
9386
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
9387
              {
5327 rajveer 9388
                org.apache.thrift.protocol.TMap _map28 = iprot.readMapBegin();
9389
                this.success = new HashMap<String,Double>(2*_map28.size);
9390
                for (int _i29 = 0; _i29 < _map28.size; ++_i29)
4494 varun.gupt 9391
                {
5327 rajveer 9392
                  String _key30; // required
9393
                  double _val31; // required
9394
                  _key30 = iprot.readString();
9395
                  _val31 = iprot.readDouble();
9396
                  this.success.put(_key30, _val31);
4494 varun.gupt 9397
                }
9398
                iprot.readMapEnd();
9399
              }
9400
            } else { 
9401
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9402
            }
9403
            break;
9404
          default:
9405
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9406
        }
9407
        iprot.readFieldEnd();
9408
      }
9409
      iprot.readStructEnd();
9410
      validate();
9411
    }
9412
 
9413
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
9414
      oprot.writeStructBegin(STRUCT_DESC);
9415
 
9416
      if (this.isSetSuccess()) {
9417
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
9418
        {
9419
          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 9420
          for (Map.Entry<String, Double> _iter32 : this.success.entrySet())
4494 varun.gupt 9421
          {
5327 rajveer 9422
            oprot.writeString(_iter32.getKey());
9423
            oprot.writeDouble(_iter32.getValue());
4494 varun.gupt 9424
          }
9425
          oprot.writeMapEnd();
9426
        }
9427
        oprot.writeFieldEnd();
9428
      }
9429
      oprot.writeFieldStop();
9430
      oprot.writeStructEnd();
9431
    }
9432
 
9433
    @Override
9434
    public String toString() {
9435
      StringBuilder sb = new StringBuilder("getDiscountsForEntity_result(");
9436
      boolean first = true;
9437
 
9438
      sb.append("success:");
9439
      if (this.success == null) {
9440
        sb.append("null");
9441
      } else {
9442
        sb.append(this.success);
9443
      }
9444
      first = false;
9445
      sb.append(")");
9446
      return sb.toString();
9447
    }
9448
 
9449
    public void validate() throws org.apache.thrift.TException {
9450
      // check for required fields
9451
    }
9452
 
9453
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
9454
      try {
9455
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
9456
      } catch (org.apache.thrift.TException te) {
9457
        throw new java.io.IOException(te);
9458
      }
9459
    }
9460
 
9461
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
9462
      try {
9463
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
9464
      } catch (org.apache.thrift.TException te) {
9465
        throw new java.io.IOException(te);
9466
      }
9467
    }
9468
 
9469
  }
9470
 
1982 varun.gupt 9471
}