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