Subversion Repositories SmartDukaan

Rev

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