Subversion Repositories SmartDukaan

Rev

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