Subversion Repositories SmartDukaan

Rev

Rev 5469 | Rev 6301 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5469 Rev 6250
Line 45... Line 45...
45
     * Returns a list of active coupons
45
     * Returns a list of active coupons
46
     */
46
     */
47
    public List<Coupon> getActiveCoupons() throws PromotionException, org.apache.thrift.TException;
47
    public List<Coupon> getActiveCoupons() throws PromotionException, org.apache.thrift.TException;
48
 
48
 
49
    /**
49
    /**
-
 
50
     * Creates a coupon and returns couponcode if successfully created
-
 
51
     * 
-
 
52
     * @param promotionId
-
 
53
     * @param endOn
-
 
54
     * @param email
-
 
55
     * @param amount
-
 
56
     * @param usage
-
 
57
     */
-
 
58
    public String createCoupon(long promotionId, long endOn, String email, long amount, long usage) throws PromotionException, org.apache.thrift.TException;
-
 
59
 
-
 
60
    /**
50
     * Returns the count of successful payments done using a given coupon
61
     * Returns the count of successful payments done using a given coupon
51
     * 
62
     * 
52
     * @param couponCode
63
     * @param couponCode
53
     */
64
     */
54
    public long getSuccessfulPaymentCountForCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException;
65
    public long getSuccessfulPaymentCountForCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException;
Line 88... Line 99...
88
 
99
 
89
    public void getCouponUsageCountByUser(String couponCode, long userId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getCouponUsageCountByUser_call> resultHandler) throws org.apache.thrift.TException;
100
    public void getCouponUsageCountByUser(String couponCode, long userId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getCouponUsageCountByUser_call> resultHandler) throws org.apache.thrift.TException;
90
 
101
 
91
    public void getActiveCoupons(org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getActiveCoupons_call> resultHandler) throws org.apache.thrift.TException;
102
    public void getActiveCoupons(org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getActiveCoupons_call> resultHandler) throws org.apache.thrift.TException;
92
 
103
 
-
 
104
    public void createCoupon(long promotionId, long endOn, String email, long amount, long usage, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.createCoupon_call> resultHandler) throws org.apache.thrift.TException;
-
 
105
 
93
    public void getSuccessfulPaymentCountForCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getSuccessfulPaymentCountForCoupon_call> resultHandler) throws org.apache.thrift.TException;
106
    public void getSuccessfulPaymentCountForCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getSuccessfulPaymentCountForCoupon_call> resultHandler) throws org.apache.thrift.TException;
94
 
107
 
95
    public void getRuleDocString(String ruleName, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getRuleDocString_call> resultHandler) throws org.apache.thrift.TException;
108
    public void getRuleDocString(String ruleName, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getRuleDocString_call> resultHandler) throws org.apache.thrift.TException;
96
 
109
 
97
    public void getItemDiscountMap(List<Long> itemIds, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getItemDiscountMap_call> resultHandler) throws org.apache.thrift.TException;
110
    public void getItemDiscountMap(List<Long> itemIds, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getItemDiscountMap_call> resultHandler) throws org.apache.thrift.TException;
Line 329... Line 342...
329
        throw result.pex;
342
        throw result.pex;
330
      }
343
      }
331
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getActiveCoupons failed: unknown result");
344
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getActiveCoupons failed: unknown result");
332
    }
345
    }
333
 
346
 
-
 
347
    public String createCoupon(long promotionId, long endOn, String email, long amount, long usage) throws PromotionException, org.apache.thrift.TException
-
 
348
    {
-
 
349
      send_createCoupon(promotionId, endOn, email, amount, usage);
-
 
350
      return recv_createCoupon();
-
 
351
    }
-
 
352
 
-
 
353
    public void send_createCoupon(long promotionId, long endOn, String email, long amount, long usage) throws org.apache.thrift.TException
-
 
354
    {
-
 
355
      createCoupon_args args = new createCoupon_args();
-
 
356
      args.setPromotionId(promotionId);
-
 
357
      args.setEndOn(endOn);
-
 
358
      args.setEmail(email);
-
 
359
      args.setAmount(amount);
-
 
360
      args.setUsage(usage);
-
 
361
      sendBase("createCoupon", args);
-
 
362
    }
-
 
363
 
-
 
364
    public String recv_createCoupon() throws PromotionException, org.apache.thrift.TException
-
 
365
    {
-
 
366
      createCoupon_result result = new createCoupon_result();
-
 
367
      receiveBase(result, "createCoupon");
-
 
368
      if (result.isSetSuccess()) {
-
 
369
        return result.success;
-
 
370
      }
-
 
371
      if (result.pex != null) {
-
 
372
        throw result.pex;
-
 
373
      }
-
 
374
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "createCoupon failed: unknown result");
-
 
375
    }
-
 
376
 
334
    public long getSuccessfulPaymentCountForCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException
377
    public long getSuccessfulPaymentCountForCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException
335
    {
378
    {
336
      send_getSuccessfulPaymentCountForCoupon(couponCode);
379
      send_getSuccessfulPaymentCountForCoupon(couponCode);
337
      return recv_getSuccessfulPaymentCountForCoupon();
380
      return recv_getSuccessfulPaymentCountForCoupon();
338
    }
381
    }
Line 789... Line 832...
789
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
832
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
790
        return (new Client(prot)).recv_getActiveCoupons();
833
        return (new Client(prot)).recv_getActiveCoupons();
791
      }
834
      }
792
    }
835
    }
793
 
836
 
-
 
837
    public void createCoupon(long promotionId, long endOn, String email, long amount, long usage, org.apache.thrift.async.AsyncMethodCallback<createCoupon_call> resultHandler) throws org.apache.thrift.TException {
-
 
838
      checkReady();
-
 
839
      createCoupon_call method_call = new createCoupon_call(promotionId, endOn, email, amount, usage, resultHandler, this, ___protocolFactory, ___transport);
-
 
840
      this.___currentMethod = method_call;
-
 
841
      ___manager.call(method_call);
-
 
842
    }
-
 
843
 
-
 
844
    public static class createCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
-
 
845
      private long promotionId;
-
 
846
      private long endOn;
-
 
847
      private String email;
-
 
848
      private long amount;
-
 
849
      private long usage;
-
 
850
      public createCoupon_call(long promotionId, long endOn, String email, long amount, long usage, org.apache.thrift.async.AsyncMethodCallback<createCoupon_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
-
 
851
        super(client, protocolFactory, transport, resultHandler, false);
-
 
852
        this.promotionId = promotionId;
-
 
853
        this.endOn = endOn;
-
 
854
        this.email = email;
-
 
855
        this.amount = amount;
-
 
856
        this.usage = usage;
-
 
857
      }
-
 
858
 
-
 
859
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
-
 
860
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
-
 
861
        createCoupon_args args = new createCoupon_args();
-
 
862
        args.setPromotionId(promotionId);
-
 
863
        args.setEndOn(endOn);
-
 
864
        args.setEmail(email);
-
 
865
        args.setAmount(amount);
-
 
866
        args.setUsage(usage);
-
 
867
        args.write(prot);
-
 
868
        prot.writeMessageEnd();
-
 
869
      }
-
 
870
 
-
 
871
      public String getResult() throws PromotionException, org.apache.thrift.TException {
-
 
872
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
-
 
873
          throw new IllegalStateException("Method call not finished!");
-
 
874
        }
-
 
875
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
-
 
876
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
-
 
877
        return (new Client(prot)).recv_createCoupon();
-
 
878
      }
-
 
879
    }
-
 
880
 
794
    public void getSuccessfulPaymentCountForCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<getSuccessfulPaymentCountForCoupon_call> resultHandler) throws org.apache.thrift.TException {
881
    public void getSuccessfulPaymentCountForCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<getSuccessfulPaymentCountForCoupon_call> resultHandler) throws org.apache.thrift.TException {
795
      checkReady();
882
      checkReady();
796
      getSuccessfulPaymentCountForCoupon_call method_call = new getSuccessfulPaymentCountForCoupon_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
883
      getSuccessfulPaymentCountForCoupon_call method_call = new getSuccessfulPaymentCountForCoupon_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
797
      this.___currentMethod = method_call;
884
      this.___currentMethod = method_call;
798
      ___manager.call(method_call);
885
      ___manager.call(method_call);
Line 1046... Line 1133...
1046
      processMap.put("generateCouponsForPromotion", new generateCouponsForPromotion());
1133
      processMap.put("generateCouponsForPromotion", new generateCouponsForPromotion());
1047
      processMap.put("applyCoupon", new applyCoupon());
1134
      processMap.put("applyCoupon", new applyCoupon());
1048
      processMap.put("trackCouponUsage", new trackCouponUsage());
1135
      processMap.put("trackCouponUsage", new trackCouponUsage());
1049
      processMap.put("getCouponUsageCountByUser", new getCouponUsageCountByUser());
1136
      processMap.put("getCouponUsageCountByUser", new getCouponUsageCountByUser());
1050
      processMap.put("getActiveCoupons", new getActiveCoupons());
1137
      processMap.put("getActiveCoupons", new getActiveCoupons());
-
 
1138
      processMap.put("createCoupon", new createCoupon());
1051
      processMap.put("getSuccessfulPaymentCountForCoupon", new getSuccessfulPaymentCountForCoupon());
1139
      processMap.put("getSuccessfulPaymentCountForCoupon", new getSuccessfulPaymentCountForCoupon());
1052
      processMap.put("getRuleDocString", new getRuleDocString());
1140
      processMap.put("getRuleDocString", new getRuleDocString());
1053
      processMap.put("getItemDiscountMap", new getItemDiscountMap());
1141
      processMap.put("getItemDiscountMap", new getItemDiscountMap());
1054
      processMap.put("getDiscountsForEntity", new getDiscountsForEntity());
1142
      processMap.put("getDiscountsForEntity", new getDiscountsForEntity());
1055
      processMap.put("addVoucher", new addVoucher());
1143
      processMap.put("addVoucher", new addVoucher());
Line 1217... Line 1305...
1217
        }
1305
        }
1218
        return result;
1306
        return result;
1219
      }
1307
      }
1220
    }
1308
    }
1221
 
1309
 
-
 
1310
    private static class createCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, createCoupon_args> {
-
 
1311
      public createCoupon() {
-
 
1312
        super("createCoupon");
-
 
1313
      }
-
 
1314
 
-
 
1315
      protected createCoupon_args getEmptyArgsInstance() {
-
 
1316
        return new createCoupon_args();
-
 
1317
      }
-
 
1318
 
-
 
1319
      protected createCoupon_result getResult(I iface, createCoupon_args args) throws org.apache.thrift.TException {
-
 
1320
        createCoupon_result result = new createCoupon_result();
-
 
1321
        try {
-
 
1322
          result.success = iface.createCoupon(args.promotionId, args.endOn, args.email, args.amount, args.usage);
-
 
1323
        } catch (PromotionException pex) {
-
 
1324
          result.pex = pex;
-
 
1325
        }
-
 
1326
        return result;
-
 
1327
      }
-
 
1328
    }
-
 
1329
 
1222
    private static class getSuccessfulPaymentCountForCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getSuccessfulPaymentCountForCoupon_args> {
1330
    private static class getSuccessfulPaymentCountForCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getSuccessfulPaymentCountForCoupon_args> {
1223
      public getSuccessfulPaymentCountForCoupon() {
1331
      public getSuccessfulPaymentCountForCoupon() {
1224
        super("getSuccessfulPaymentCountForCoupon");
1332
        super("getSuccessfulPaymentCountForCoupon");
1225
      }
1333
      }
1226
 
1334
 
Line 7026... Line 7134...
7026
      boolean first = true;
7134
      boolean first = true;
7027
 
7135
 
7028
      sb.append("success:");
7136
      sb.append("success:");
7029
      if (this.success == null) {
7137
      if (this.success == null) {
7030
        sb.append("null");
7138
        sb.append("null");
-
 
7139
      } else {
-
 
7140
        sb.append(this.success);
-
 
7141
      }
-
 
7142
      first = false;
-
 
7143
      if (!first) sb.append(", ");
-
 
7144
      sb.append("pex:");
-
 
7145
      if (this.pex == null) {
-
 
7146
        sb.append("null");
-
 
7147
      } else {
-
 
7148
        sb.append(this.pex);
-
 
7149
      }
-
 
7150
      first = false;
-
 
7151
      sb.append(")");
-
 
7152
      return sb.toString();
-
 
7153
    }
-
 
7154
 
-
 
7155
    public void validate() throws org.apache.thrift.TException {
-
 
7156
      // check for required fields
-
 
7157
    }
-
 
7158
 
-
 
7159
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
-
 
7160
      try {
-
 
7161
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
-
 
7162
      } catch (org.apache.thrift.TException te) {
-
 
7163
        throw new java.io.IOException(te);
-
 
7164
      }
-
 
7165
    }
-
 
7166
 
-
 
7167
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
-
 
7168
      try {
-
 
7169
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
-
 
7170
      } catch (org.apache.thrift.TException te) {
-
 
7171
        throw new java.io.IOException(te);
-
 
7172
      }
-
 
7173
    }
-
 
7174
 
-
 
7175
  }
-
 
7176
 
-
 
7177
  public static class createCoupon_args implements org.apache.thrift.TBase<createCoupon_args, createCoupon_args._Fields>, java.io.Serializable, Cloneable   {
-
 
7178
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createCoupon_args");
-
 
7179
 
-
 
7180
    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);
-
 
7181
    private static final org.apache.thrift.protocol.TField END_ON_FIELD_DESC = new org.apache.thrift.protocol.TField("endOn", org.apache.thrift.protocol.TType.I64, (short)2);
-
 
7182
    private static final org.apache.thrift.protocol.TField EMAIL_FIELD_DESC = new org.apache.thrift.protocol.TField("email", org.apache.thrift.protocol.TType.STRING, (short)3);
-
 
7183
    private static final org.apache.thrift.protocol.TField AMOUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("amount", org.apache.thrift.protocol.TType.I64, (short)4);
-
 
7184
    private static final org.apache.thrift.protocol.TField USAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("usage", org.apache.thrift.protocol.TType.I64, (short)5);
-
 
7185
 
-
 
7186
    private long promotionId; // required
-
 
7187
    private long endOn; // required
-
 
7188
    private String email; // required
-
 
7189
    private long amount; // required
-
 
7190
    private long usage; // required
-
 
7191
 
-
 
7192
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-
 
7193
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
-
 
7194
      PROMOTION_ID((short)1, "promotionId"),
-
 
7195
      END_ON((short)2, "endOn"),
-
 
7196
      EMAIL((short)3, "email"),
-
 
7197
      AMOUNT((short)4, "amount"),
-
 
7198
      USAGE((short)5, "usage");
-
 
7199
 
-
 
7200
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
 
7201
 
-
 
7202
      static {
-
 
7203
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
-
 
7204
          byName.put(field.getFieldName(), field);
-
 
7205
        }
-
 
7206
      }
-
 
7207
 
-
 
7208
      /**
-
 
7209
       * Find the _Fields constant that matches fieldId, or null if its not found.
-
 
7210
       */
-
 
7211
      public static _Fields findByThriftId(int fieldId) {
-
 
7212
        switch(fieldId) {
-
 
7213
          case 1: // PROMOTION_ID
-
 
7214
            return PROMOTION_ID;
-
 
7215
          case 2: // END_ON
-
 
7216
            return END_ON;
-
 
7217
          case 3: // EMAIL
-
 
7218
            return EMAIL;
-
 
7219
          case 4: // AMOUNT
-
 
7220
            return AMOUNT;
-
 
7221
          case 5: // USAGE
-
 
7222
            return USAGE;
-
 
7223
          default:
-
 
7224
            return null;
-
 
7225
        }
-
 
7226
      }
-
 
7227
 
-
 
7228
      /**
-
 
7229
       * Find the _Fields constant that matches fieldId, throwing an exception
-
 
7230
       * if it is not found.
-
 
7231
       */
-
 
7232
      public static _Fields findByThriftIdOrThrow(int fieldId) {
-
 
7233
        _Fields fields = findByThriftId(fieldId);
-
 
7234
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-
 
7235
        return fields;
-
 
7236
      }
-
 
7237
 
-
 
7238
      /**
-
 
7239
       * Find the _Fields constant that matches name, or null if its not found.
-
 
7240
       */
-
 
7241
      public static _Fields findByName(String name) {
-
 
7242
        return byName.get(name);
-
 
7243
      }
-
 
7244
 
-
 
7245
      private final short _thriftId;
-
 
7246
      private final String _fieldName;
-
 
7247
 
-
 
7248
      _Fields(short thriftId, String fieldName) {
-
 
7249
        _thriftId = thriftId;
-
 
7250
        _fieldName = fieldName;
-
 
7251
      }
-
 
7252
 
-
 
7253
      public short getThriftFieldId() {
-
 
7254
        return _thriftId;
-
 
7255
      }
-
 
7256
 
-
 
7257
      public String getFieldName() {
-
 
7258
        return _fieldName;
-
 
7259
      }
-
 
7260
    }
-
 
7261
 
-
 
7262
    // isset id assignments
-
 
7263
    private static final int __PROMOTIONID_ISSET_ID = 0;
-
 
7264
    private static final int __ENDON_ISSET_ID = 1;
-
 
7265
    private static final int __AMOUNT_ISSET_ID = 2;
-
 
7266
    private static final int __USAGE_ISSET_ID = 3;
-
 
7267
    private BitSet __isset_bit_vector = new BitSet(4);
-
 
7268
 
-
 
7269
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
-
 
7270
    static {
-
 
7271
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
-
 
7272
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
7273
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
-
 
7274
      tmpMap.put(_Fields.END_ON, new org.apache.thrift.meta_data.FieldMetaData("endOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
7275
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
-
 
7276
      tmpMap.put(_Fields.EMAIL, new org.apache.thrift.meta_data.FieldMetaData("email", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
7277
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-
 
7278
      tmpMap.put(_Fields.AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("amount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
7279
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
-
 
7280
      tmpMap.put(_Fields.USAGE, new org.apache.thrift.meta_data.FieldMetaData("usage", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
7281
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
-
 
7282
      metaDataMap = Collections.unmodifiableMap(tmpMap);
-
 
7283
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createCoupon_args.class, metaDataMap);
-
 
7284
    }
-
 
7285
 
-
 
7286
    public createCoupon_args() {
-
 
7287
    }
-
 
7288
 
-
 
7289
    public createCoupon_args(
-
 
7290
      long promotionId,
-
 
7291
      long endOn,
-
 
7292
      String email,
-
 
7293
      long amount,
-
 
7294
      long usage)
-
 
7295
    {
-
 
7296
      this();
-
 
7297
      this.promotionId = promotionId;
-
 
7298
      setPromotionIdIsSet(true);
-
 
7299
      this.endOn = endOn;
-
 
7300
      setEndOnIsSet(true);
-
 
7301
      this.email = email;
-
 
7302
      this.amount = amount;
-
 
7303
      setAmountIsSet(true);
-
 
7304
      this.usage = usage;
-
 
7305
      setUsageIsSet(true);
-
 
7306
    }
-
 
7307
 
-
 
7308
    /**
-
 
7309
     * Performs a deep copy on <i>other</i>.
-
 
7310
     */
-
 
7311
    public createCoupon_args(createCoupon_args other) {
-
 
7312
      __isset_bit_vector.clear();
-
 
7313
      __isset_bit_vector.or(other.__isset_bit_vector);
-
 
7314
      this.promotionId = other.promotionId;
-
 
7315
      this.endOn = other.endOn;
-
 
7316
      if (other.isSetEmail()) {
-
 
7317
        this.email = other.email;
-
 
7318
      }
-
 
7319
      this.amount = other.amount;
-
 
7320
      this.usage = other.usage;
-
 
7321
    }
-
 
7322
 
-
 
7323
    public createCoupon_args deepCopy() {
-
 
7324
      return new createCoupon_args(this);
-
 
7325
    }
-
 
7326
 
-
 
7327
    @Override
-
 
7328
    public void clear() {
-
 
7329
      setPromotionIdIsSet(false);
-
 
7330
      this.promotionId = 0;
-
 
7331
      setEndOnIsSet(false);
-
 
7332
      this.endOn = 0;
-
 
7333
      this.email = null;
-
 
7334
      setAmountIsSet(false);
-
 
7335
      this.amount = 0;
-
 
7336
      setUsageIsSet(false);
-
 
7337
      this.usage = 0;
-
 
7338
    }
-
 
7339
 
-
 
7340
    public long getPromotionId() {
-
 
7341
      return this.promotionId;
-
 
7342
    }
-
 
7343
 
-
 
7344
    public void setPromotionId(long promotionId) {
-
 
7345
      this.promotionId = promotionId;
-
 
7346
      setPromotionIdIsSet(true);
-
 
7347
    }
-
 
7348
 
-
 
7349
    public void unsetPromotionId() {
-
 
7350
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
-
 
7351
    }
-
 
7352
 
-
 
7353
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
-
 
7354
    public boolean isSetPromotionId() {
-
 
7355
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
-
 
7356
    }
-
 
7357
 
-
 
7358
    public void setPromotionIdIsSet(boolean value) {
-
 
7359
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
-
 
7360
    }
-
 
7361
 
-
 
7362
    public long getEndOn() {
-
 
7363
      return this.endOn;
-
 
7364
    }
-
 
7365
 
-
 
7366
    public void setEndOn(long endOn) {
-
 
7367
      this.endOn = endOn;
-
 
7368
      setEndOnIsSet(true);
-
 
7369
    }
-
 
7370
 
-
 
7371
    public void unsetEndOn() {
-
 
7372
      __isset_bit_vector.clear(__ENDON_ISSET_ID);
-
 
7373
    }
-
 
7374
 
-
 
7375
    /** Returns true if field endOn is set (has been assigned a value) and false otherwise */
-
 
7376
    public boolean isSetEndOn() {
-
 
7377
      return __isset_bit_vector.get(__ENDON_ISSET_ID);
-
 
7378
    }
-
 
7379
 
-
 
7380
    public void setEndOnIsSet(boolean value) {
-
 
7381
      __isset_bit_vector.set(__ENDON_ISSET_ID, value);
-
 
7382
    }
-
 
7383
 
-
 
7384
    public String getEmail() {
-
 
7385
      return this.email;
-
 
7386
    }
-
 
7387
 
-
 
7388
    public void setEmail(String email) {
-
 
7389
      this.email = email;
-
 
7390
    }
-
 
7391
 
-
 
7392
    public void unsetEmail() {
-
 
7393
      this.email = null;
-
 
7394
    }
-
 
7395
 
-
 
7396
    /** Returns true if field email is set (has been assigned a value) and false otherwise */
-
 
7397
    public boolean isSetEmail() {
-
 
7398
      return this.email != null;
-
 
7399
    }
-
 
7400
 
-
 
7401
    public void setEmailIsSet(boolean value) {
-
 
7402
      if (!value) {
-
 
7403
        this.email = null;
-
 
7404
      }
-
 
7405
    }
-
 
7406
 
-
 
7407
    public long getAmount() {
-
 
7408
      return this.amount;
-
 
7409
    }
-
 
7410
 
-
 
7411
    public void setAmount(long amount) {
-
 
7412
      this.amount = amount;
-
 
7413
      setAmountIsSet(true);
-
 
7414
    }
-
 
7415
 
-
 
7416
    public void unsetAmount() {
-
 
7417
      __isset_bit_vector.clear(__AMOUNT_ISSET_ID);
-
 
7418
    }
-
 
7419
 
-
 
7420
    /** Returns true if field amount is set (has been assigned a value) and false otherwise */
-
 
7421
    public boolean isSetAmount() {
-
 
7422
      return __isset_bit_vector.get(__AMOUNT_ISSET_ID);
-
 
7423
    }
-
 
7424
 
-
 
7425
    public void setAmountIsSet(boolean value) {
-
 
7426
      __isset_bit_vector.set(__AMOUNT_ISSET_ID, value);
-
 
7427
    }
-
 
7428
 
-
 
7429
    public long getUsage() {
-
 
7430
      return this.usage;
-
 
7431
    }
-
 
7432
 
-
 
7433
    public void setUsage(long usage) {
-
 
7434
      this.usage = usage;
-
 
7435
      setUsageIsSet(true);
-
 
7436
    }
-
 
7437
 
-
 
7438
    public void unsetUsage() {
-
 
7439
      __isset_bit_vector.clear(__USAGE_ISSET_ID);
-
 
7440
    }
-
 
7441
 
-
 
7442
    /** Returns true if field usage is set (has been assigned a value) and false otherwise */
-
 
7443
    public boolean isSetUsage() {
-
 
7444
      return __isset_bit_vector.get(__USAGE_ISSET_ID);
-
 
7445
    }
-
 
7446
 
-
 
7447
    public void setUsageIsSet(boolean value) {
-
 
7448
      __isset_bit_vector.set(__USAGE_ISSET_ID, value);
-
 
7449
    }
-
 
7450
 
-
 
7451
    public void setFieldValue(_Fields field, Object value) {
-
 
7452
      switch (field) {
-
 
7453
      case PROMOTION_ID:
-
 
7454
        if (value == null) {
-
 
7455
          unsetPromotionId();
-
 
7456
        } else {
-
 
7457
          setPromotionId((Long)value);
-
 
7458
        }
-
 
7459
        break;
-
 
7460
 
-
 
7461
      case END_ON:
-
 
7462
        if (value == null) {
-
 
7463
          unsetEndOn();
-
 
7464
        } else {
-
 
7465
          setEndOn((Long)value);
-
 
7466
        }
-
 
7467
        break;
-
 
7468
 
-
 
7469
      case EMAIL:
-
 
7470
        if (value == null) {
-
 
7471
          unsetEmail();
-
 
7472
        } else {
-
 
7473
          setEmail((String)value);
-
 
7474
        }
-
 
7475
        break;
-
 
7476
 
-
 
7477
      case AMOUNT:
-
 
7478
        if (value == null) {
-
 
7479
          unsetAmount();
-
 
7480
        } else {
-
 
7481
          setAmount((Long)value);
-
 
7482
        }
-
 
7483
        break;
-
 
7484
 
-
 
7485
      case USAGE:
-
 
7486
        if (value == null) {
-
 
7487
          unsetUsage();
-
 
7488
        } else {
-
 
7489
          setUsage((Long)value);
-
 
7490
        }
-
 
7491
        break;
-
 
7492
 
-
 
7493
      }
-
 
7494
    }
-
 
7495
 
-
 
7496
    public Object getFieldValue(_Fields field) {
-
 
7497
      switch (field) {
-
 
7498
      case PROMOTION_ID:
-
 
7499
        return Long.valueOf(getPromotionId());
-
 
7500
 
-
 
7501
      case END_ON:
-
 
7502
        return Long.valueOf(getEndOn());
-
 
7503
 
-
 
7504
      case EMAIL:
-
 
7505
        return getEmail();
-
 
7506
 
-
 
7507
      case AMOUNT:
-
 
7508
        return Long.valueOf(getAmount());
-
 
7509
 
-
 
7510
      case USAGE:
-
 
7511
        return Long.valueOf(getUsage());
-
 
7512
 
-
 
7513
      }
-
 
7514
      throw new IllegalStateException();
-
 
7515
    }
-
 
7516
 
-
 
7517
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
-
 
7518
    public boolean isSet(_Fields field) {
-
 
7519
      if (field == null) {
-
 
7520
        throw new IllegalArgumentException();
-
 
7521
      }
-
 
7522
 
-
 
7523
      switch (field) {
-
 
7524
      case PROMOTION_ID:
-
 
7525
        return isSetPromotionId();
-
 
7526
      case END_ON:
-
 
7527
        return isSetEndOn();
-
 
7528
      case EMAIL:
-
 
7529
        return isSetEmail();
-
 
7530
      case AMOUNT:
-
 
7531
        return isSetAmount();
-
 
7532
      case USAGE:
-
 
7533
        return isSetUsage();
-
 
7534
      }
-
 
7535
      throw new IllegalStateException();
-
 
7536
    }
-
 
7537
 
-
 
7538
    @Override
-
 
7539
    public boolean equals(Object that) {
-
 
7540
      if (that == null)
-
 
7541
        return false;
-
 
7542
      if (that instanceof createCoupon_args)
-
 
7543
        return this.equals((createCoupon_args)that);
-
 
7544
      return false;
-
 
7545
    }
-
 
7546
 
-
 
7547
    public boolean equals(createCoupon_args that) {
-
 
7548
      if (that == null)
-
 
7549
        return false;
-
 
7550
 
-
 
7551
      boolean this_present_promotionId = true;
-
 
7552
      boolean that_present_promotionId = true;
-
 
7553
      if (this_present_promotionId || that_present_promotionId) {
-
 
7554
        if (!(this_present_promotionId && that_present_promotionId))
-
 
7555
          return false;
-
 
7556
        if (this.promotionId != that.promotionId)
-
 
7557
          return false;
-
 
7558
      }
-
 
7559
 
-
 
7560
      boolean this_present_endOn = true;
-
 
7561
      boolean that_present_endOn = true;
-
 
7562
      if (this_present_endOn || that_present_endOn) {
-
 
7563
        if (!(this_present_endOn && that_present_endOn))
-
 
7564
          return false;
-
 
7565
        if (this.endOn != that.endOn)
-
 
7566
          return false;
-
 
7567
      }
-
 
7568
 
-
 
7569
      boolean this_present_email = true && this.isSetEmail();
-
 
7570
      boolean that_present_email = true && that.isSetEmail();
-
 
7571
      if (this_present_email || that_present_email) {
-
 
7572
        if (!(this_present_email && that_present_email))
-
 
7573
          return false;
-
 
7574
        if (!this.email.equals(that.email))
-
 
7575
          return false;
-
 
7576
      }
-
 
7577
 
-
 
7578
      boolean this_present_amount = true;
-
 
7579
      boolean that_present_amount = true;
-
 
7580
      if (this_present_amount || that_present_amount) {
-
 
7581
        if (!(this_present_amount && that_present_amount))
-
 
7582
          return false;
-
 
7583
        if (this.amount != that.amount)
-
 
7584
          return false;
-
 
7585
      }
-
 
7586
 
-
 
7587
      boolean this_present_usage = true;
-
 
7588
      boolean that_present_usage = true;
-
 
7589
      if (this_present_usage || that_present_usage) {
-
 
7590
        if (!(this_present_usage && that_present_usage))
-
 
7591
          return false;
-
 
7592
        if (this.usage != that.usage)
-
 
7593
          return false;
-
 
7594
      }
-
 
7595
 
-
 
7596
      return true;
-
 
7597
    }
-
 
7598
 
-
 
7599
    @Override
-
 
7600
    public int hashCode() {
-
 
7601
      return 0;
-
 
7602
    }
-
 
7603
 
-
 
7604
    public int compareTo(createCoupon_args other) {
-
 
7605
      if (!getClass().equals(other.getClass())) {
-
 
7606
        return getClass().getName().compareTo(other.getClass().getName());
-
 
7607
      }
-
 
7608
 
-
 
7609
      int lastComparison = 0;
-
 
7610
      createCoupon_args typedOther = (createCoupon_args)other;
-
 
7611
 
-
 
7612
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
-
 
7613
      if (lastComparison != 0) {
-
 
7614
        return lastComparison;
-
 
7615
      }
-
 
7616
      if (isSetPromotionId()) {
-
 
7617
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
-
 
7618
        if (lastComparison != 0) {
-
 
7619
          return lastComparison;
-
 
7620
        }
-
 
7621
      }
-
 
7622
      lastComparison = Boolean.valueOf(isSetEndOn()).compareTo(typedOther.isSetEndOn());
-
 
7623
      if (lastComparison != 0) {
-
 
7624
        return lastComparison;
-
 
7625
      }
-
 
7626
      if (isSetEndOn()) {
-
 
7627
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endOn, typedOther.endOn);
-
 
7628
        if (lastComparison != 0) {
-
 
7629
          return lastComparison;
-
 
7630
        }
-
 
7631
      }
-
 
7632
      lastComparison = Boolean.valueOf(isSetEmail()).compareTo(typedOther.isSetEmail());
-
 
7633
      if (lastComparison != 0) {
-
 
7634
        return lastComparison;
-
 
7635
      }
-
 
7636
      if (isSetEmail()) {
-
 
7637
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.email, typedOther.email);
-
 
7638
        if (lastComparison != 0) {
-
 
7639
          return lastComparison;
-
 
7640
        }
-
 
7641
      }
-
 
7642
      lastComparison = Boolean.valueOf(isSetAmount()).compareTo(typedOther.isSetAmount());
-
 
7643
      if (lastComparison != 0) {
-
 
7644
        return lastComparison;
-
 
7645
      }
-
 
7646
      if (isSetAmount()) {
-
 
7647
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.amount, typedOther.amount);
-
 
7648
        if (lastComparison != 0) {
-
 
7649
          return lastComparison;
-
 
7650
        }
-
 
7651
      }
-
 
7652
      lastComparison = Boolean.valueOf(isSetUsage()).compareTo(typedOther.isSetUsage());
-
 
7653
      if (lastComparison != 0) {
-
 
7654
        return lastComparison;
-
 
7655
      }
-
 
7656
      if (isSetUsage()) {
-
 
7657
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.usage, typedOther.usage);
-
 
7658
        if (lastComparison != 0) {
-
 
7659
          return lastComparison;
-
 
7660
        }
-
 
7661
      }
-
 
7662
      return 0;
-
 
7663
    }
-
 
7664
 
-
 
7665
    public _Fields fieldForId(int fieldId) {
-
 
7666
      return _Fields.findByThriftId(fieldId);
-
 
7667
    }
-
 
7668
 
-
 
7669
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
-
 
7670
      org.apache.thrift.protocol.TField field;
-
 
7671
      iprot.readStructBegin();
-
 
7672
      while (true)
-
 
7673
      {
-
 
7674
        field = iprot.readFieldBegin();
-
 
7675
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
-
 
7676
          break;
-
 
7677
        }
-
 
7678
        switch (field.id) {
-
 
7679
          case 1: // PROMOTION_ID
-
 
7680
            if (field.type == org.apache.thrift.protocol.TType.I64) {
-
 
7681
              this.promotionId = iprot.readI64();
-
 
7682
              setPromotionIdIsSet(true);
-
 
7683
            } else { 
-
 
7684
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-
 
7685
            }
-
 
7686
            break;
-
 
7687
          case 2: // END_ON
-
 
7688
            if (field.type == org.apache.thrift.protocol.TType.I64) {
-
 
7689
              this.endOn = iprot.readI64();
-
 
7690
              setEndOnIsSet(true);
-
 
7691
            } else { 
-
 
7692
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-
 
7693
            }
-
 
7694
            break;
-
 
7695
          case 3: // EMAIL
-
 
7696
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
-
 
7697
              this.email = iprot.readString();
-
 
7698
            } else { 
-
 
7699
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-
 
7700
            }
-
 
7701
            break;
-
 
7702
          case 4: // AMOUNT
-
 
7703
            if (field.type == org.apache.thrift.protocol.TType.I64) {
-
 
7704
              this.amount = iprot.readI64();
-
 
7705
              setAmountIsSet(true);
-
 
7706
            } else { 
-
 
7707
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-
 
7708
            }
-
 
7709
            break;
-
 
7710
          case 5: // USAGE
-
 
7711
            if (field.type == org.apache.thrift.protocol.TType.I64) {
-
 
7712
              this.usage = iprot.readI64();
-
 
7713
              setUsageIsSet(true);
-
 
7714
            } else { 
-
 
7715
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-
 
7716
            }
-
 
7717
            break;
-
 
7718
          default:
-
 
7719
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-
 
7720
        }
-
 
7721
        iprot.readFieldEnd();
-
 
7722
      }
-
 
7723
      iprot.readStructEnd();
-
 
7724
      validate();
-
 
7725
    }
-
 
7726
 
-
 
7727
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
-
 
7728
      validate();
-
 
7729
 
-
 
7730
      oprot.writeStructBegin(STRUCT_DESC);
-
 
7731
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
-
 
7732
      oprot.writeI64(this.promotionId);
-
 
7733
      oprot.writeFieldEnd();
-
 
7734
      oprot.writeFieldBegin(END_ON_FIELD_DESC);
-
 
7735
      oprot.writeI64(this.endOn);
-
 
7736
      oprot.writeFieldEnd();
-
 
7737
      if (this.email != null) {
-
 
7738
        oprot.writeFieldBegin(EMAIL_FIELD_DESC);
-
 
7739
        oprot.writeString(this.email);
-
 
7740
        oprot.writeFieldEnd();
-
 
7741
      }
-
 
7742
      oprot.writeFieldBegin(AMOUNT_FIELD_DESC);
-
 
7743
      oprot.writeI64(this.amount);
-
 
7744
      oprot.writeFieldEnd();
-
 
7745
      oprot.writeFieldBegin(USAGE_FIELD_DESC);
-
 
7746
      oprot.writeI64(this.usage);
-
 
7747
      oprot.writeFieldEnd();
-
 
7748
      oprot.writeFieldStop();
-
 
7749
      oprot.writeStructEnd();
-
 
7750
    }
-
 
7751
 
-
 
7752
    @Override
-
 
7753
    public String toString() {
-
 
7754
      StringBuilder sb = new StringBuilder("createCoupon_args(");
-
 
7755
      boolean first = true;
-
 
7756
 
-
 
7757
      sb.append("promotionId:");
-
 
7758
      sb.append(this.promotionId);
-
 
7759
      first = false;
-
 
7760
      if (!first) sb.append(", ");
-
 
7761
      sb.append("endOn:");
-
 
7762
      sb.append(this.endOn);
-
 
7763
      first = false;
-
 
7764
      if (!first) sb.append(", ");
-
 
7765
      sb.append("email:");
-
 
7766
      if (this.email == null) {
-
 
7767
        sb.append("null");
-
 
7768
      } else {
-
 
7769
        sb.append(this.email);
-
 
7770
      }
-
 
7771
      first = false;
-
 
7772
      if (!first) sb.append(", ");
-
 
7773
      sb.append("amount:");
-
 
7774
      sb.append(this.amount);
-
 
7775
      first = false;
-
 
7776
      if (!first) sb.append(", ");
-
 
7777
      sb.append("usage:");
-
 
7778
      sb.append(this.usage);
-
 
7779
      first = false;
-
 
7780
      sb.append(")");
-
 
7781
      return sb.toString();
-
 
7782
    }
-
 
7783
 
-
 
7784
    public void validate() throws org.apache.thrift.TException {
-
 
7785
      // check for required fields
-
 
7786
    }
-
 
7787
 
-
 
7788
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
-
 
7789
      try {
-
 
7790
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
-
 
7791
      } catch (org.apache.thrift.TException te) {
-
 
7792
        throw new java.io.IOException(te);
-
 
7793
      }
-
 
7794
    }
-
 
7795
 
-
 
7796
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
-
 
7797
      try {
-
 
7798
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
-
 
7799
      } catch (org.apache.thrift.TException te) {
-
 
7800
        throw new java.io.IOException(te);
-
 
7801
      }
-
 
7802
    }
-
 
7803
 
-
 
7804
  }
-
 
7805
 
-
 
7806
  public static class createCoupon_result implements org.apache.thrift.TBase<createCoupon_result, createCoupon_result._Fields>, java.io.Serializable, Cloneable   {
-
 
7807
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createCoupon_result");
-
 
7808
 
-
 
7809
    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);
-
 
7810
    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);
-
 
7811
 
-
 
7812
    private String success; // required
-
 
7813
    private PromotionException pex; // required
-
 
7814
 
-
 
7815
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-
 
7816
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
-
 
7817
      SUCCESS((short)0, "success"),
-
 
7818
      PEX((short)1, "pex");
-
 
7819
 
-
 
7820
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
 
7821
 
-
 
7822
      static {
-
 
7823
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
-
 
7824
          byName.put(field.getFieldName(), field);
-
 
7825
        }
-
 
7826
      }
-
 
7827
 
-
 
7828
      /**
-
 
7829
       * Find the _Fields constant that matches fieldId, or null if its not found.
-
 
7830
       */
-
 
7831
      public static _Fields findByThriftId(int fieldId) {
-
 
7832
        switch(fieldId) {
-
 
7833
          case 0: // SUCCESS
-
 
7834
            return SUCCESS;
-
 
7835
          case 1: // PEX
-
 
7836
            return PEX;
-
 
7837
          default:
-
 
7838
            return null;
-
 
7839
        }
-
 
7840
      }
-
 
7841
 
-
 
7842
      /**
-
 
7843
       * Find the _Fields constant that matches fieldId, throwing an exception
-
 
7844
       * if it is not found.
-
 
7845
       */
-
 
7846
      public static _Fields findByThriftIdOrThrow(int fieldId) {
-
 
7847
        _Fields fields = findByThriftId(fieldId);
-
 
7848
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-
 
7849
        return fields;
-
 
7850
      }
-
 
7851
 
-
 
7852
      /**
-
 
7853
       * Find the _Fields constant that matches name, or null if its not found.
-
 
7854
       */
-
 
7855
      public static _Fields findByName(String name) {
-
 
7856
        return byName.get(name);
-
 
7857
      }
-
 
7858
 
-
 
7859
      private final short _thriftId;
-
 
7860
      private final String _fieldName;
-
 
7861
 
-
 
7862
      _Fields(short thriftId, String fieldName) {
-
 
7863
        _thriftId = thriftId;
-
 
7864
        _fieldName = fieldName;
-
 
7865
      }
-
 
7866
 
-
 
7867
      public short getThriftFieldId() {
-
 
7868
        return _thriftId;
-
 
7869
      }
-
 
7870
 
-
 
7871
      public String getFieldName() {
-
 
7872
        return _fieldName;
-
 
7873
      }
-
 
7874
    }
-
 
7875
 
-
 
7876
    // isset id assignments
-
 
7877
 
-
 
7878
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
-
 
7879
    static {
-
 
7880
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
-
 
7881
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
7882
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-
 
7883
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
7884
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
-
 
7885
      metaDataMap = Collections.unmodifiableMap(tmpMap);
-
 
7886
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createCoupon_result.class, metaDataMap);
-
 
7887
    }
-
 
7888
 
-
 
7889
    public createCoupon_result() {
-
 
7890
    }
-
 
7891
 
-
 
7892
    public createCoupon_result(
-
 
7893
      String success,
-
 
7894
      PromotionException pex)
-
 
7895
    {
-
 
7896
      this();
-
 
7897
      this.success = success;
-
 
7898
      this.pex = pex;
-
 
7899
    }
-
 
7900
 
-
 
7901
    /**
-
 
7902
     * Performs a deep copy on <i>other</i>.
-
 
7903
     */
-
 
7904
    public createCoupon_result(createCoupon_result other) {
-
 
7905
      if (other.isSetSuccess()) {
-
 
7906
        this.success = other.success;
-
 
7907
      }
-
 
7908
      if (other.isSetPex()) {
-
 
7909
        this.pex = new PromotionException(other.pex);
-
 
7910
      }
-
 
7911
    }
-
 
7912
 
-
 
7913
    public createCoupon_result deepCopy() {
-
 
7914
      return new createCoupon_result(this);
-
 
7915
    }
-
 
7916
 
-
 
7917
    @Override
-
 
7918
    public void clear() {
-
 
7919
      this.success = null;
-
 
7920
      this.pex = null;
-
 
7921
    }
-
 
7922
 
-
 
7923
    public String getSuccess() {
-
 
7924
      return this.success;
-
 
7925
    }
-
 
7926
 
-
 
7927
    public void setSuccess(String success) {
-
 
7928
      this.success = success;
-
 
7929
    }
-
 
7930
 
-
 
7931
    public void unsetSuccess() {
-
 
7932
      this.success = null;
-
 
7933
    }
-
 
7934
 
-
 
7935
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
-
 
7936
    public boolean isSetSuccess() {
-
 
7937
      return this.success != null;
-
 
7938
    }
-
 
7939
 
-
 
7940
    public void setSuccessIsSet(boolean value) {
-
 
7941
      if (!value) {
-
 
7942
        this.success = null;
-
 
7943
      }
-
 
7944
    }
-
 
7945
 
-
 
7946
    public PromotionException getPex() {
-
 
7947
      return this.pex;
-
 
7948
    }
-
 
7949
 
-
 
7950
    public void setPex(PromotionException pex) {
-
 
7951
      this.pex = pex;
-
 
7952
    }
-
 
7953
 
-
 
7954
    public void unsetPex() {
-
 
7955
      this.pex = null;
-
 
7956
    }
-
 
7957
 
-
 
7958
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
-
 
7959
    public boolean isSetPex() {
-
 
7960
      return this.pex != null;
-
 
7961
    }
-
 
7962
 
-
 
7963
    public void setPexIsSet(boolean value) {
-
 
7964
      if (!value) {
-
 
7965
        this.pex = null;
-
 
7966
      }
-
 
7967
    }
-
 
7968
 
-
 
7969
    public void setFieldValue(_Fields field, Object value) {
-
 
7970
      switch (field) {
-
 
7971
      case SUCCESS:
-
 
7972
        if (value == null) {
-
 
7973
          unsetSuccess();
-
 
7974
        } else {
-
 
7975
          setSuccess((String)value);
-
 
7976
        }
-
 
7977
        break;
-
 
7978
 
-
 
7979
      case PEX:
-
 
7980
        if (value == null) {
-
 
7981
          unsetPex();
-
 
7982
        } else {
-
 
7983
          setPex((PromotionException)value);
-
 
7984
        }
-
 
7985
        break;
-
 
7986
 
-
 
7987
      }
-
 
7988
    }
-
 
7989
 
-
 
7990
    public Object getFieldValue(_Fields field) {
-
 
7991
      switch (field) {
-
 
7992
      case SUCCESS:
-
 
7993
        return getSuccess();
-
 
7994
 
-
 
7995
      case PEX:
-
 
7996
        return getPex();
-
 
7997
 
-
 
7998
      }
-
 
7999
      throw new IllegalStateException();
-
 
8000
    }
-
 
8001
 
-
 
8002
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
-
 
8003
    public boolean isSet(_Fields field) {
-
 
8004
      if (field == null) {
-
 
8005
        throw new IllegalArgumentException();
-
 
8006
      }
-
 
8007
 
-
 
8008
      switch (field) {
-
 
8009
      case SUCCESS:
-
 
8010
        return isSetSuccess();
-
 
8011
      case PEX:
-
 
8012
        return isSetPex();
-
 
8013
      }
-
 
8014
      throw new IllegalStateException();
-
 
8015
    }
-
 
8016
 
-
 
8017
    @Override
-
 
8018
    public boolean equals(Object that) {
-
 
8019
      if (that == null)
-
 
8020
        return false;
-
 
8021
      if (that instanceof createCoupon_result)
-
 
8022
        return this.equals((createCoupon_result)that);
-
 
8023
      return false;
-
 
8024
    }
-
 
8025
 
-
 
8026
    public boolean equals(createCoupon_result that) {
-
 
8027
      if (that == null)
-
 
8028
        return false;
-
 
8029
 
-
 
8030
      boolean this_present_success = true && this.isSetSuccess();
-
 
8031
      boolean that_present_success = true && that.isSetSuccess();
-
 
8032
      if (this_present_success || that_present_success) {
-
 
8033
        if (!(this_present_success && that_present_success))
-
 
8034
          return false;
-
 
8035
        if (!this.success.equals(that.success))
-
 
8036
          return false;
-
 
8037
      }
-
 
8038
 
-
 
8039
      boolean this_present_pex = true && this.isSetPex();
-
 
8040
      boolean that_present_pex = true && that.isSetPex();
-
 
8041
      if (this_present_pex || that_present_pex) {
-
 
8042
        if (!(this_present_pex && that_present_pex))
-
 
8043
          return false;
-
 
8044
        if (!this.pex.equals(that.pex))
-
 
8045
          return false;
-
 
8046
      }
-
 
8047
 
-
 
8048
      return true;
-
 
8049
    }
-
 
8050
 
-
 
8051
    @Override
-
 
8052
    public int hashCode() {
-
 
8053
      return 0;
-
 
8054
    }
-
 
8055
 
-
 
8056
    public int compareTo(createCoupon_result other) {
-
 
8057
      if (!getClass().equals(other.getClass())) {
-
 
8058
        return getClass().getName().compareTo(other.getClass().getName());
-
 
8059
      }
-
 
8060
 
-
 
8061
      int lastComparison = 0;
-
 
8062
      createCoupon_result typedOther = (createCoupon_result)other;
-
 
8063
 
-
 
8064
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
-
 
8065
      if (lastComparison != 0) {
-
 
8066
        return lastComparison;
-
 
8067
      }
-
 
8068
      if (isSetSuccess()) {
-
 
8069
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
-
 
8070
        if (lastComparison != 0) {
-
 
8071
          return lastComparison;
-
 
8072
        }
-
 
8073
      }
-
 
8074
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
-
 
8075
      if (lastComparison != 0) {
-
 
8076
        return lastComparison;
-
 
8077
      }
-
 
8078
      if (isSetPex()) {
-
 
8079
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
-
 
8080
        if (lastComparison != 0) {
-
 
8081
          return lastComparison;
-
 
8082
        }
-
 
8083
      }
-
 
8084
      return 0;
-
 
8085
    }
-
 
8086
 
-
 
8087
    public _Fields fieldForId(int fieldId) {
-
 
8088
      return _Fields.findByThriftId(fieldId);
-
 
8089
    }
-
 
8090
 
-
 
8091
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
-
 
8092
      org.apache.thrift.protocol.TField field;
-
 
8093
      iprot.readStructBegin();
-
 
8094
      while (true)
-
 
8095
      {
-
 
8096
        field = iprot.readFieldBegin();
-
 
8097
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
-
 
8098
          break;
-
 
8099
        }
-
 
8100
        switch (field.id) {
-
 
8101
          case 0: // SUCCESS
-
 
8102
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
-
 
8103
              this.success = iprot.readString();
-
 
8104
            } else { 
-
 
8105
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-
 
8106
            }
-
 
8107
            break;
-
 
8108
          case 1: // PEX
-
 
8109
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
-
 
8110
              this.pex = new PromotionException();
-
 
8111
              this.pex.read(iprot);
-
 
8112
            } else { 
-
 
8113
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-
 
8114
            }
-
 
8115
            break;
-
 
8116
          default:
-
 
8117
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-
 
8118
        }
-
 
8119
        iprot.readFieldEnd();
-
 
8120
      }
-
 
8121
      iprot.readStructEnd();
-
 
8122
      validate();
-
 
8123
    }
-
 
8124
 
-
 
8125
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
-
 
8126
      oprot.writeStructBegin(STRUCT_DESC);
-
 
8127
 
-
 
8128
      if (this.isSetSuccess()) {
-
 
8129
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
-
 
8130
        oprot.writeString(this.success);
-
 
8131
        oprot.writeFieldEnd();
-
 
8132
      } else if (this.isSetPex()) {
-
 
8133
        oprot.writeFieldBegin(PEX_FIELD_DESC);
-
 
8134
        this.pex.write(oprot);
-
 
8135
        oprot.writeFieldEnd();
-
 
8136
      }
-
 
8137
      oprot.writeFieldStop();
-
 
8138
      oprot.writeStructEnd();
-
 
8139
    }
-
 
8140
 
-
 
8141
    @Override
-
 
8142
    public String toString() {
-
 
8143
      StringBuilder sb = new StringBuilder("createCoupon_result(");
-
 
8144
      boolean first = true;
-
 
8145
 
-
 
8146
      sb.append("success:");
-
 
8147
      if (this.success == null) {
-
 
8148
        sb.append("null");
7031
      } else {
8149
      } else {
7032
        sb.append(this.success);
8150
        sb.append(this.success);
7033
      }
8151
      }
7034
      first = false;
8152
      first = false;
7035
      if (!first) sb.append(", ");
8153
      if (!first) sb.append(", ");