Subversion Repositories SmartDukaan

Rev

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