Subversion Repositories SmartDukaan

Rev

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

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