Subversion Repositories SmartDukaan

Rev

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

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