Subversion Repositories SmartDukaan

Rev

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