Subversion Repositories SmartDukaan

Rev

Rev 2690 | Rev 2747 | 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
    /**
2060 ankur.sing 59
     * get all payments for user. If gatewayId is 0, then it is ignored while filtering.
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
 
2462 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
 
126
    /**
2708 chandransh 127
     * Captures an already authorized EBS Payment and returns a map containing the details of the captured transaction
2462 chandransh 128
     * 
129
     * @param merchantPaymentId
130
     */
2708 chandransh 131
    public Map<String,String> captureEbsPayment(long merchantPaymentId) throws PaymentException, TException;
132
 
133
    /**
134
     * Captures an already authorized Hdfc Payment and returns a map containing the details of the captured transaction
135
     * 
136
     * @param merchantPaymentId
137
     */
2462 chandransh 138
    public Map<String,String> captureHdfcPayment(long merchantPaymentId) throws PaymentException, TException;
139
 
140
    /**
141
     * Initialize the payment pipe for a HDFC payment. The URL the user should be redirected to is returned.
142
     * In case of any processing error, an exception is raised.
143
     * 
144
     * @param merchantPaymentId
145
     */
146
    public String initializeHdfcPayment(long merchantPaymentId) throws PaymentException, TException;
147
 
2690 chandransh 148
    /**
149
     * Create a refund of the given amount corresponding to the given order to be processed through the same
150
     * payment gateway which processed the payment for the corresponding transaction.
151
     * Returns the id of the newly created Refund.
152
     * 
153
     * @param orderId
154
     * @param merchantTxnId
155
     * @param amount
156
     */
157
    public long createRefund(long orderId, long merchantTxnId, double amount) throws PaymentException, TException;
158
 
123 ashish 159
  }
160
 
161
  public static class Client implements Iface {
162
    public Client(TProtocol prot)
163
    {
164
      this(prot, prot);
165
    }
166
 
167
    public Client(TProtocol iprot, TProtocol oprot)
168
    {
169
      iprot_ = iprot;
170
      oprot_ = oprot;
171
    }
172
 
173
    protected TProtocol iprot_;
174
    protected TProtocol oprot_;
175
 
176
    protected int seqid_;
177
 
178
    public TProtocol getInputProtocol()
179
    {
180
      return this.iprot_;
181
    }
182
 
183
    public TProtocol getOutputProtocol()
184
    {
185
      return this.oprot_;
186
    }
187
 
764 rajveer 188
    public void closeSession() throws TException
189
    {
190
      send_closeSession();
191
      recv_closeSession();
192
    }
193
 
194
    public void send_closeSession() throws TException
195
    {
196
      oprot_.writeMessageBegin(new TMessage("closeSession", TMessageType.CALL, seqid_));
197
      closeSession_args args = new closeSession_args();
198
      args.write(oprot_);
199
      oprot_.writeMessageEnd();
200
      oprot_.getTransport().flush();
201
    }
202
 
203
    public void recv_closeSession() throws TException
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
      closeSession_result result = new closeSession_result();
212
      result.read(iprot_);
213
      iprot_.readMessageEnd();
214
      return;
215
    }
216
 
695 rajveer 217
    public long createPayment(long userId, double amount, long gatewayId, long txnId) throws PaymentException, TException
123 ashish 218
    {
695 rajveer 219
      send_createPayment(userId, amount, gatewayId, txnId);
123 ashish 220
      return recv_createPayment();
221
    }
222
 
695 rajveer 223
    public void send_createPayment(long userId, double amount, long gatewayId, long txnId) throws TException
123 ashish 224
    {
225
      oprot_.writeMessageBegin(new TMessage("createPayment", TMessageType.CALL, seqid_));
226
      createPayment_args args = new createPayment_args();
695 rajveer 227
      args.userId = userId;
123 ashish 228
      args.amount = amount;
695 rajveer 229
      args.gatewayId = gatewayId;
230
      args.txnId = txnId;
123 ashish 231
      args.write(oprot_);
232
      oprot_.writeMessageEnd();
233
      oprot_.getTransport().flush();
234
    }
235
 
420 ashish 236
    public long recv_createPayment() throws PaymentException, TException
123 ashish 237
    {
238
      TMessage msg = iprot_.readMessageBegin();
239
      if (msg.type == TMessageType.EXCEPTION) {
240
        TApplicationException x = TApplicationException.read(iprot_);
241
        iprot_.readMessageEnd();
242
        throw x;
243
      }
244
      createPayment_result result = new createPayment_result();
245
      result.read(iprot_);
246
      iprot_.readMessageEnd();
247
      if (result.isSetSuccess()) {
248
        return result.success;
249
      }
250
      if (result.pe != null) {
251
        throw result.pe;
252
      }
253
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "createPayment failed: unknown result");
254
    }
255
 
695 rajveer 256
    public List<Payment> getPaymentsForUser(long userId, long fromTime, long toTime, PaymentStatus status, long gatewayId) throws PaymentException, TException
123 ashish 257
    {
695 rajveer 258
      send_getPaymentsForUser(userId, fromTime, toTime, status, gatewayId);
123 ashish 259
      return recv_getPaymentsForUser();
260
    }
261
 
695 rajveer 262
    public void send_getPaymentsForUser(long userId, long fromTime, long toTime, PaymentStatus status, long gatewayId) throws TException
123 ashish 263
    {
264
      oprot_.writeMessageBegin(new TMessage("getPaymentsForUser", TMessageType.CALL, seqid_));
265
      getPaymentsForUser_args args = new getPaymentsForUser_args();
266
      args.userId = userId;
695 rajveer 267
      args.fromTime = fromTime;
268
      args.toTime = toTime;
123 ashish 269
      args.status = status;
695 rajveer 270
      args.gatewayId = gatewayId;
123 ashish 271
      args.write(oprot_);
272
      oprot_.writeMessageEnd();
273
      oprot_.getTransport().flush();
274
    }
275
 
276
    public List<Payment> recv_getPaymentsForUser() throws PaymentException, TException
277
    {
278
      TMessage msg = iprot_.readMessageBegin();
279
      if (msg.type == TMessageType.EXCEPTION) {
280
        TApplicationException x = TApplicationException.read(iprot_);
281
        iprot_.readMessageEnd();
282
        throw x;
283
      }
284
      getPaymentsForUser_result result = new getPaymentsForUser_result();
285
      result.read(iprot_);
286
      iprot_.readMessageEnd();
287
      if (result.isSetSuccess()) {
288
        return result.success;
289
      }
290
      if (result.pe != null) {
291
        throw result.pe;
292
      }
293
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getPaymentsForUser failed: unknown result");
294
    }
295
 
695 rajveer 296
    public List<Payment> getPayments(long fromTime, long toTime, PaymentStatus status, long gatewayId) throws PaymentException, TException
123 ashish 297
    {
695 rajveer 298
      send_getPayments(fromTime, toTime, status, gatewayId);
123 ashish 299
      return recv_getPayments();
300
    }
301
 
695 rajveer 302
    public void send_getPayments(long fromTime, long toTime, PaymentStatus status, long gatewayId) throws TException
123 ashish 303
    {
304
      oprot_.writeMessageBegin(new TMessage("getPayments", TMessageType.CALL, seqid_));
305
      getPayments_args args = new getPayments_args();
695 rajveer 306
      args.fromTime = fromTime;
307
      args.toTime = toTime;
123 ashish 308
      args.status = status;
695 rajveer 309
      args.gatewayId = gatewayId;
123 ashish 310
      args.write(oprot_);
311
      oprot_.writeMessageEnd();
312
      oprot_.getTransport().flush();
313
    }
314
 
315
    public List<Payment> recv_getPayments() throws PaymentException, TException
316
    {
317
      TMessage msg = iprot_.readMessageBegin();
318
      if (msg.type == TMessageType.EXCEPTION) {
319
        TApplicationException x = TApplicationException.read(iprot_);
320
        iprot_.readMessageEnd();
321
        throw x;
322
      }
323
      getPayments_result result = new getPayments_result();
324
      result.read(iprot_);
325
      iprot_.readMessageEnd();
326
      if (result.isSetSuccess()) {
327
        return result.success;
328
      }
329
      if (result.pe != null) {
330
        throw result.pe;
331
      }
332
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getPayments failed: unknown result");
333
    }
334
 
420 ashish 335
    public PaymentGateway getPaymentGateway(long id) throws PaymentException, TException
336
    {
337
      send_getPaymentGateway(id);
338
      return recv_getPaymentGateway();
339
    }
340
 
341
    public void send_getPaymentGateway(long id) throws TException
342
    {
343
      oprot_.writeMessageBegin(new TMessage("getPaymentGateway", TMessageType.CALL, seqid_));
344
      getPaymentGateway_args args = new getPaymentGateway_args();
345
      args.id = id;
346
      args.write(oprot_);
347
      oprot_.writeMessageEnd();
348
      oprot_.getTransport().flush();
349
    }
350
 
351
    public PaymentGateway recv_getPaymentGateway() throws PaymentException, TException
352
    {
353
      TMessage msg = iprot_.readMessageBegin();
354
      if (msg.type == TMessageType.EXCEPTION) {
355
        TApplicationException x = TApplicationException.read(iprot_);
356
        iprot_.readMessageEnd();
357
        throw x;
358
      }
359
      getPaymentGateway_result result = new getPaymentGateway_result();
360
      result.read(iprot_);
361
      iprot_.readMessageEnd();
362
      if (result.isSetSuccess()) {
363
        return result.success;
364
      }
365
      if (result.pe != null) {
366
        throw result.pe;
367
      }
368
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getPaymentGateway failed: unknown result");
369
    }
370
 
695 rajveer 371
    public Payment getPayment(long id) throws PaymentException, TException
420 ashish 372
    {
695 rajveer 373
      send_getPayment(id);
374
      return recv_getPayment();
420 ashish 375
    }
376
 
695 rajveer 377
    public void send_getPayment(long id) throws TException
420 ashish 378
    {
695 rajveer 379
      oprot_.writeMessageBegin(new TMessage("getPayment", TMessageType.CALL, seqid_));
380
      getPayment_args args = new getPayment_args();
420 ashish 381
      args.id = id;
382
      args.write(oprot_);
383
      oprot_.writeMessageEnd();
384
      oprot_.getTransport().flush();
385
    }
386
 
695 rajveer 387
    public Payment recv_getPayment() throws PaymentException, TException
420 ashish 388
    {
389
      TMessage msg = iprot_.readMessageBegin();
390
      if (msg.type == TMessageType.EXCEPTION) {
391
        TApplicationException x = TApplicationException.read(iprot_);
392
        iprot_.readMessageEnd();
393
        throw x;
394
      }
695 rajveer 395
      getPayment_result result = new getPayment_result();
420 ashish 396
      result.read(iprot_);
397
      iprot_.readMessageEnd();
695 rajveer 398
      if (result.isSetSuccess()) {
399
        return result.success;
400
      }
420 ashish 401
      if (result.pe != null) {
402
        throw result.pe;
403
      }
695 rajveer 404
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getPayment failed: unknown result");
420 ashish 405
    }
406
 
695 rajveer 407
    public List<Payment> getPaymentForTxnId(long txnId) throws PaymentException, TException
420 ashish 408
    {
695 rajveer 409
      send_getPaymentForTxnId(txnId);
410
      return recv_getPaymentForTxnId();
420 ashish 411
    }
412
 
695 rajveer 413
    public void send_getPaymentForTxnId(long txnId) throws TException
420 ashish 414
    {
695 rajveer 415
      oprot_.writeMessageBegin(new TMessage("getPaymentForTxnId", TMessageType.CALL, seqid_));
416
      getPaymentForTxnId_args args = new getPaymentForTxnId_args();
417
      args.txnId = txnId;
420 ashish 418
      args.write(oprot_);
419
      oprot_.writeMessageEnd();
420
      oprot_.getTransport().flush();
421
    }
422
 
695 rajveer 423
    public List<Payment> recv_getPaymentForTxnId() throws PaymentException, TException
420 ashish 424
    {
425
      TMessage msg = iprot_.readMessageBegin();
426
      if (msg.type == TMessageType.EXCEPTION) {
427
        TApplicationException x = TApplicationException.read(iprot_);
428
        iprot_.readMessageEnd();
429
        throw x;
430
      }
695 rajveer 431
      getPaymentForTxnId_result result = new getPaymentForTxnId_result();
420 ashish 432
      result.read(iprot_);
433
      iprot_.readMessageEnd();
434
      if (result.isSetSuccess()) {
435
        return result.success;
436
      }
437
      if (result.pe != null) {
438
        throw result.pe;
439
      }
695 rajveer 440
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getPaymentForTxnId failed: unknown result");
420 ashish 441
    }
442
 
1119 rajveer 443
    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 444
    {
1119 rajveer 445
      send_updatePaymentDetails(id, gatewayPaymentId, sessionId, gatewayTxnStatus, description, gatewayTxnId, authCode, referenceCode, errorCode, status, gatewayTxnDate, attributes);
695 rajveer 446
      return recv_updatePaymentDetails();
420 ashish 447
    }
448
 
1119 rajveer 449
    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 450
    {
695 rajveer 451
      oprot_.writeMessageBegin(new TMessage("updatePaymentDetails", TMessageType.CALL, seqid_));
452
      updatePaymentDetails_args args = new updatePaymentDetails_args();
420 ashish 453
      args.id = id;
695 rajveer 454
      args.gatewayPaymentId = gatewayPaymentId;
455
      args.sessionId = sessionId;
456
      args.gatewayTxnStatus = gatewayTxnStatus;
457
      args.description = description;
458
      args.gatewayTxnId = gatewayTxnId;
459
      args.authCode = authCode;
460
      args.referenceCode = referenceCode;
461
      args.errorCode = errorCode;
462
      args.status = status;
1119 rajveer 463
      args.gatewayTxnDate = gatewayTxnDate;
695 rajveer 464
      args.attributes = attributes;
420 ashish 465
      args.write(oprot_);
466
      oprot_.writeMessageEnd();
467
      oprot_.getTransport().flush();
468
    }
469
 
695 rajveer 470
    public boolean recv_updatePaymentDetails() throws PaymentException, TException
420 ashish 471
    {
472
      TMessage msg = iprot_.readMessageBegin();
473
      if (msg.type == TMessageType.EXCEPTION) {
474
        TApplicationException x = TApplicationException.read(iprot_);
475
        iprot_.readMessageEnd();
476
        throw x;
477
      }
695 rajveer 478
      updatePaymentDetails_result result = new updatePaymentDetails_result();
420 ashish 479
      result.read(iprot_);
480
      iprot_.readMessageEnd();
695 rajveer 481
      if (result.isSetSuccess()) {
482
        return result.success;
483
      }
420 ashish 484
      if (result.pe != null) {
485
        throw result.pe;
486
      }
695 rajveer 487
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "updatePaymentDetails failed: unknown result");
420 ashish 488
    }
489
 
1731 ankur.sing 490
    public List<Double> getSuccessfulPaymentsAmountRange() throws TException
1629 ankur.sing 491
    {
1731 ankur.sing 492
      send_getSuccessfulPaymentsAmountRange();
493
      return recv_getSuccessfulPaymentsAmountRange();
1629 ankur.sing 494
    }
495
 
1731 ankur.sing 496
    public void send_getSuccessfulPaymentsAmountRange() throws TException
1629 ankur.sing 497
    {
1731 ankur.sing 498
      oprot_.writeMessageBegin(new TMessage("getSuccessfulPaymentsAmountRange", TMessageType.CALL, seqid_));
499
      getSuccessfulPaymentsAmountRange_args args = new getSuccessfulPaymentsAmountRange_args();
1629 ankur.sing 500
      args.write(oprot_);
501
      oprot_.writeMessageEnd();
502
      oprot_.getTransport().flush();
503
    }
504
 
1731 ankur.sing 505
    public List<Double> recv_getSuccessfulPaymentsAmountRange() throws TException
1629 ankur.sing 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
      }
1731 ankur.sing 513
      getSuccessfulPaymentsAmountRange_result result = new getSuccessfulPaymentsAmountRange_result();
1629 ankur.sing 514
      result.read(iprot_);
515
      iprot_.readMessageEnd();
516
      if (result.isSetSuccess()) {
517
        return result.success;
518
      }
1731 ankur.sing 519
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getSuccessfulPaymentsAmountRange failed: unknown result");
1629 ankur.sing 520
    }
521
 
2462 chandransh 522
    public Payment updateAndCaptureEbsPayment(Map<String,String> paymentParams) throws PaymentException, TException
523
    {
524
      send_updateAndCaptureEbsPayment(paymentParams);
525
      return recv_updateAndCaptureEbsPayment();
526
    }
527
 
528
    public void send_updateAndCaptureEbsPayment(Map<String,String> paymentParams) throws TException
529
    {
530
      oprot_.writeMessageBegin(new TMessage("updateAndCaptureEbsPayment", TMessageType.CALL, seqid_));
531
      updateAndCaptureEbsPayment_args args = new updateAndCaptureEbsPayment_args();
532
      args.paymentParams = paymentParams;
533
      args.write(oprot_);
534
      oprot_.writeMessageEnd();
535
      oprot_.getTransport().flush();
536
    }
537
 
538
    public Payment recv_updateAndCaptureEbsPayment() throws PaymentException, TException
539
    {
540
      TMessage msg = iprot_.readMessageBegin();
541
      if (msg.type == TMessageType.EXCEPTION) {
542
        TApplicationException x = TApplicationException.read(iprot_);
543
        iprot_.readMessageEnd();
544
        throw x;
545
      }
546
      updateAndCaptureEbsPayment_result result = new updateAndCaptureEbsPayment_result();
547
      result.read(iprot_);
548
      iprot_.readMessageEnd();
549
      if (result.isSetSuccess()) {
550
        return result.success;
551
      }
552
      if (result.pe != null) {
553
        throw result.pe;
554
      }
555
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "updateAndCaptureEbsPayment failed: unknown result");
556
    }
557
 
2708 chandransh 558
    public Map<String,String> captureEbsPayment(long merchantPaymentId) throws PaymentException, TException
559
    {
560
      send_captureEbsPayment(merchantPaymentId);
561
      return recv_captureEbsPayment();
562
    }
563
 
564
    public void send_captureEbsPayment(long merchantPaymentId) throws TException
565
    {
566
      oprot_.writeMessageBegin(new TMessage("captureEbsPayment", TMessageType.CALL, seqid_));
567
      captureEbsPayment_args args = new captureEbsPayment_args();
568
      args.merchantPaymentId = merchantPaymentId;
569
      args.write(oprot_);
570
      oprot_.writeMessageEnd();
571
      oprot_.getTransport().flush();
572
    }
573
 
574
    public Map<String,String> recv_captureEbsPayment() throws PaymentException, TException
575
    {
576
      TMessage msg = iprot_.readMessageBegin();
577
      if (msg.type == TMessageType.EXCEPTION) {
578
        TApplicationException x = TApplicationException.read(iprot_);
579
        iprot_.readMessageEnd();
580
        throw x;
581
      }
582
      captureEbsPayment_result result = new captureEbsPayment_result();
583
      result.read(iprot_);
584
      iprot_.readMessageEnd();
585
      if (result.isSetSuccess()) {
586
        return result.success;
587
      }
588
      if (result.pe != null) {
589
        throw result.pe;
590
      }
591
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "captureEbsPayment failed: unknown result");
592
    }
593
 
2462 chandransh 594
    public Map<String,String> captureHdfcPayment(long merchantPaymentId) throws PaymentException, TException
595
    {
596
      send_captureHdfcPayment(merchantPaymentId);
597
      return recv_captureHdfcPayment();
598
    }
599
 
600
    public void send_captureHdfcPayment(long merchantPaymentId) throws TException
601
    {
602
      oprot_.writeMessageBegin(new TMessage("captureHdfcPayment", TMessageType.CALL, seqid_));
603
      captureHdfcPayment_args args = new captureHdfcPayment_args();
604
      args.merchantPaymentId = merchantPaymentId;
605
      args.write(oprot_);
606
      oprot_.writeMessageEnd();
607
      oprot_.getTransport().flush();
608
    }
609
 
610
    public Map<String,String> recv_captureHdfcPayment() throws PaymentException, TException
611
    {
612
      TMessage msg = iprot_.readMessageBegin();
613
      if (msg.type == TMessageType.EXCEPTION) {
614
        TApplicationException x = TApplicationException.read(iprot_);
615
        iprot_.readMessageEnd();
616
        throw x;
617
      }
618
      captureHdfcPayment_result result = new captureHdfcPayment_result();
619
      result.read(iprot_);
620
      iprot_.readMessageEnd();
621
      if (result.isSetSuccess()) {
622
        return result.success;
623
      }
624
      if (result.pe != null) {
625
        throw result.pe;
626
      }
627
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "captureHdfcPayment failed: unknown result");
628
    }
629
 
630
    public String initializeHdfcPayment(long merchantPaymentId) throws PaymentException, TException
631
    {
632
      send_initializeHdfcPayment(merchantPaymentId);
633
      return recv_initializeHdfcPayment();
634
    }
635
 
636
    public void send_initializeHdfcPayment(long merchantPaymentId) throws TException
637
    {
638
      oprot_.writeMessageBegin(new TMessage("initializeHdfcPayment", TMessageType.CALL, seqid_));
639
      initializeHdfcPayment_args args = new initializeHdfcPayment_args();
640
      args.merchantPaymentId = merchantPaymentId;
641
      args.write(oprot_);
642
      oprot_.writeMessageEnd();
643
      oprot_.getTransport().flush();
644
    }
645
 
646
    public String recv_initializeHdfcPayment() throws PaymentException, TException
647
    {
648
      TMessage msg = iprot_.readMessageBegin();
649
      if (msg.type == TMessageType.EXCEPTION) {
650
        TApplicationException x = TApplicationException.read(iprot_);
651
        iprot_.readMessageEnd();
652
        throw x;
653
      }
654
      initializeHdfcPayment_result result = new initializeHdfcPayment_result();
655
      result.read(iprot_);
656
      iprot_.readMessageEnd();
657
      if (result.isSetSuccess()) {
658
        return result.success;
659
      }
660
      if (result.pe != null) {
661
        throw result.pe;
662
      }
663
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "initializeHdfcPayment failed: unknown result");
664
    }
665
 
2690 chandransh 666
    public long createRefund(long orderId, long merchantTxnId, double amount) throws PaymentException, TException
667
    {
668
      send_createRefund(orderId, merchantTxnId, amount);
669
      return recv_createRefund();
670
    }
671
 
672
    public void send_createRefund(long orderId, long merchantTxnId, double amount) throws TException
673
    {
674
      oprot_.writeMessageBegin(new TMessage("createRefund", TMessageType.CALL, seqid_));
675
      createRefund_args args = new createRefund_args();
676
      args.orderId = orderId;
677
      args.merchantTxnId = merchantTxnId;
678
      args.amount = amount;
679
      args.write(oprot_);
680
      oprot_.writeMessageEnd();
681
      oprot_.getTransport().flush();
682
    }
683
 
684
    public long recv_createRefund() throws PaymentException, TException
685
    {
686
      TMessage msg = iprot_.readMessageBegin();
687
      if (msg.type == TMessageType.EXCEPTION) {
688
        TApplicationException x = TApplicationException.read(iprot_);
689
        iprot_.readMessageEnd();
690
        throw x;
691
      }
692
      createRefund_result result = new createRefund_result();
693
      result.read(iprot_);
694
      iprot_.readMessageEnd();
695
      if (result.isSetSuccess()) {
696
        return result.success;
697
      }
698
      if (result.pe != null) {
699
        throw result.pe;
700
      }
701
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "createRefund failed: unknown result");
702
    }
703
 
123 ashish 704
  }
705
  public static class Processor implements TProcessor {
706
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
707
    public Processor(Iface iface)
708
    {
709
      iface_ = iface;
764 rajveer 710
      processMap_.put("closeSession", new closeSession());
123 ashish 711
      processMap_.put("createPayment", new createPayment());
712
      processMap_.put("getPaymentsForUser", new getPaymentsForUser());
713
      processMap_.put("getPayments", new getPayments());
420 ashish 714
      processMap_.put("getPaymentGateway", new getPaymentGateway());
715
      processMap_.put("getPayment", new getPayment());
695 rajveer 716
      processMap_.put("getPaymentForTxnId", new getPaymentForTxnId());
717
      processMap_.put("updatePaymentDetails", new updatePaymentDetails());
1731 ankur.sing 718
      processMap_.put("getSuccessfulPaymentsAmountRange", new getSuccessfulPaymentsAmountRange());
2462 chandransh 719
      processMap_.put("updateAndCaptureEbsPayment", new updateAndCaptureEbsPayment());
2708 chandransh 720
      processMap_.put("captureEbsPayment", new captureEbsPayment());
2462 chandransh 721
      processMap_.put("captureHdfcPayment", new captureHdfcPayment());
722
      processMap_.put("initializeHdfcPayment", new initializeHdfcPayment());
2690 chandransh 723
      processMap_.put("createRefund", new createRefund());
123 ashish 724
    }
725
 
726
    protected static interface ProcessFunction {
727
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException;
728
    }
729
 
730
    private Iface iface_;
731
    protected final HashMap<String,ProcessFunction> processMap_ = new HashMap<String,ProcessFunction>();
732
 
733
    public boolean process(TProtocol iprot, TProtocol oprot) throws TException
734
    {
735
      TMessage msg = iprot.readMessageBegin();
736
      ProcessFunction fn = processMap_.get(msg.name);
737
      if (fn == null) {
738
        TProtocolUtil.skip(iprot, TType.STRUCT);
739
        iprot.readMessageEnd();
740
        TApplicationException x = new TApplicationException(TApplicationException.UNKNOWN_METHOD, "Invalid method name: '"+msg.name+"'");
741
        oprot.writeMessageBegin(new TMessage(msg.name, TMessageType.EXCEPTION, msg.seqid));
742
        x.write(oprot);
743
        oprot.writeMessageEnd();
744
        oprot.getTransport().flush();
745
        return true;
746
      }
747
      fn.process(msg.seqid, iprot, oprot);
748
      return true;
749
    }
750
 
764 rajveer 751
    private class closeSession implements ProcessFunction {
752
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
753
      {
754
        closeSession_args args = new closeSession_args();
755
        args.read(iprot);
756
        iprot.readMessageEnd();
757
        closeSession_result result = new closeSession_result();
758
        iface_.closeSession();
759
        oprot.writeMessageBegin(new TMessage("closeSession", TMessageType.REPLY, seqid));
760
        result.write(oprot);
761
        oprot.writeMessageEnd();
762
        oprot.getTransport().flush();
763
      }
764
 
765
    }
766
 
123 ashish 767
    private class createPayment implements ProcessFunction {
768
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
769
      {
770
        createPayment_args args = new createPayment_args();
771
        args.read(iprot);
772
        iprot.readMessageEnd();
773
        createPayment_result result = new createPayment_result();
774
        try {
695 rajveer 775
          result.success = iface_.createPayment(args.userId, args.amount, args.gatewayId, args.txnId);
420 ashish 776
          result.setSuccessIsSet(true);
123 ashish 777
        } catch (PaymentException pe) {
778
          result.pe = pe;
779
        } catch (Throwable th) {
780
          LOGGER.error("Internal error processing createPayment", th);
781
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing createPayment");
782
          oprot.writeMessageBegin(new TMessage("createPayment", TMessageType.EXCEPTION, seqid));
783
          x.write(oprot);
784
          oprot.writeMessageEnd();
785
          oprot.getTransport().flush();
786
          return;
787
        }
788
        oprot.writeMessageBegin(new TMessage("createPayment", TMessageType.REPLY, seqid));
789
        result.write(oprot);
790
        oprot.writeMessageEnd();
791
        oprot.getTransport().flush();
792
      }
793
 
794
    }
795
 
796
    private class getPaymentsForUser implements ProcessFunction {
797
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
798
      {
799
        getPaymentsForUser_args args = new getPaymentsForUser_args();
800
        args.read(iprot);
801
        iprot.readMessageEnd();
802
        getPaymentsForUser_result result = new getPaymentsForUser_result();
803
        try {
695 rajveer 804
          result.success = iface_.getPaymentsForUser(args.userId, args.fromTime, args.toTime, args.status, args.gatewayId);
123 ashish 805
        } catch (PaymentException pe) {
806
          result.pe = pe;
807
        } catch (Throwable th) {
808
          LOGGER.error("Internal error processing getPaymentsForUser", th);
809
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getPaymentsForUser");
810
          oprot.writeMessageBegin(new TMessage("getPaymentsForUser", TMessageType.EXCEPTION, seqid));
811
          x.write(oprot);
812
          oprot.writeMessageEnd();
813
          oprot.getTransport().flush();
814
          return;
815
        }
816
        oprot.writeMessageBegin(new TMessage("getPaymentsForUser", TMessageType.REPLY, seqid));
817
        result.write(oprot);
818
        oprot.writeMessageEnd();
819
        oprot.getTransport().flush();
820
      }
821
 
822
    }
823
 
824
    private class getPayments implements ProcessFunction {
825
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
826
      {
827
        getPayments_args args = new getPayments_args();
828
        args.read(iprot);
829
        iprot.readMessageEnd();
830
        getPayments_result result = new getPayments_result();
831
        try {
695 rajveer 832
          result.success = iface_.getPayments(args.fromTime, args.toTime, args.status, args.gatewayId);
123 ashish 833
        } catch (PaymentException pe) {
834
          result.pe = pe;
835
        } catch (Throwable th) {
836
          LOGGER.error("Internal error processing getPayments", th);
837
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getPayments");
838
          oprot.writeMessageBegin(new TMessage("getPayments", TMessageType.EXCEPTION, seqid));
839
          x.write(oprot);
840
          oprot.writeMessageEnd();
841
          oprot.getTransport().flush();
842
          return;
843
        }
844
        oprot.writeMessageBegin(new TMessage("getPayments", TMessageType.REPLY, seqid));
845
        result.write(oprot);
846
        oprot.writeMessageEnd();
847
        oprot.getTransport().flush();
848
      }
849
 
850
    }
851
 
420 ashish 852
    private class getPaymentGateway implements ProcessFunction {
853
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
854
      {
855
        getPaymentGateway_args args = new getPaymentGateway_args();
856
        args.read(iprot);
857
        iprot.readMessageEnd();
858
        getPaymentGateway_result result = new getPaymentGateway_result();
859
        try {
860
          result.success = iface_.getPaymentGateway(args.id);
861
        } catch (PaymentException pe) {
862
          result.pe = pe;
863
        } catch (Throwable th) {
864
          LOGGER.error("Internal error processing getPaymentGateway", th);
865
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getPaymentGateway");
866
          oprot.writeMessageBegin(new TMessage("getPaymentGateway", TMessageType.EXCEPTION, seqid));
867
          x.write(oprot);
868
          oprot.writeMessageEnd();
869
          oprot.getTransport().flush();
870
          return;
871
        }
872
        oprot.writeMessageBegin(new TMessage("getPaymentGateway", TMessageType.REPLY, seqid));
873
        result.write(oprot);
874
        oprot.writeMessageEnd();
875
        oprot.getTransport().flush();
876
      }
877
 
878
    }
879
 
695 rajveer 880
    private class getPayment implements ProcessFunction {
420 ashish 881
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
882
      {
695 rajveer 883
        getPayment_args args = new getPayment_args();
420 ashish 884
        args.read(iprot);
885
        iprot.readMessageEnd();
695 rajveer 886
        getPayment_result result = new getPayment_result();
420 ashish 887
        try {
695 rajveer 888
          result.success = iface_.getPayment(args.id);
420 ashish 889
        } catch (PaymentException pe) {
890
          result.pe = pe;
891
        } catch (Throwable th) {
695 rajveer 892
          LOGGER.error("Internal error processing getPayment", th);
893
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getPayment");
894
          oprot.writeMessageBegin(new TMessage("getPayment", TMessageType.EXCEPTION, seqid));
420 ashish 895
          x.write(oprot);
896
          oprot.writeMessageEnd();
897
          oprot.getTransport().flush();
898
          return;
899
        }
695 rajveer 900
        oprot.writeMessageBegin(new TMessage("getPayment", TMessageType.REPLY, seqid));
420 ashish 901
        result.write(oprot);
902
        oprot.writeMessageEnd();
903
        oprot.getTransport().flush();
904
      }
905
 
906
    }
907
 
695 rajveer 908
    private class getPaymentForTxnId implements ProcessFunction {
420 ashish 909
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
910
      {
695 rajveer 911
        getPaymentForTxnId_args args = new getPaymentForTxnId_args();
420 ashish 912
        args.read(iprot);
913
        iprot.readMessageEnd();
695 rajveer 914
        getPaymentForTxnId_result result = new getPaymentForTxnId_result();
420 ashish 915
        try {
695 rajveer 916
          result.success = iface_.getPaymentForTxnId(args.txnId);
420 ashish 917
        } catch (PaymentException pe) {
918
          result.pe = pe;
919
        } catch (Throwable th) {
695 rajveer 920
          LOGGER.error("Internal error processing getPaymentForTxnId", th);
921
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getPaymentForTxnId");
922
          oprot.writeMessageBegin(new TMessage("getPaymentForTxnId", TMessageType.EXCEPTION, seqid));
420 ashish 923
          x.write(oprot);
924
          oprot.writeMessageEnd();
925
          oprot.getTransport().flush();
926
          return;
927
        }
695 rajveer 928
        oprot.writeMessageBegin(new TMessage("getPaymentForTxnId", TMessageType.REPLY, seqid));
420 ashish 929
        result.write(oprot);
930
        oprot.writeMessageEnd();
931
        oprot.getTransport().flush();
932
      }
933
 
934
    }
935
 
695 rajveer 936
    private class updatePaymentDetails implements ProcessFunction {
420 ashish 937
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
938
      {
695 rajveer 939
        updatePaymentDetails_args args = new updatePaymentDetails_args();
420 ashish 940
        args.read(iprot);
941
        iprot.readMessageEnd();
695 rajveer 942
        updatePaymentDetails_result result = new updatePaymentDetails_result();
420 ashish 943
        try {
1119 rajveer 944
          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 945
          result.setSuccessIsSet(true);
420 ashish 946
        } catch (PaymentException pe) {
947
          result.pe = pe;
948
        } catch (Throwable th) {
695 rajveer 949
          LOGGER.error("Internal error processing updatePaymentDetails", th);
950
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing updatePaymentDetails");
951
          oprot.writeMessageBegin(new TMessage("updatePaymentDetails", TMessageType.EXCEPTION, seqid));
420 ashish 952
          x.write(oprot);
953
          oprot.writeMessageEnd();
954
          oprot.getTransport().flush();
955
          return;
956
        }
695 rajveer 957
        oprot.writeMessageBegin(new TMessage("updatePaymentDetails", TMessageType.REPLY, seqid));
420 ashish 958
        result.write(oprot);
959
        oprot.writeMessageEnd();
960
        oprot.getTransport().flush();
961
      }
962
 
963
    }
964
 
1731 ankur.sing 965
    private class getSuccessfulPaymentsAmountRange implements ProcessFunction {
1629 ankur.sing 966
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
967
      {
1731 ankur.sing 968
        getSuccessfulPaymentsAmountRange_args args = new getSuccessfulPaymentsAmountRange_args();
1629 ankur.sing 969
        args.read(iprot);
970
        iprot.readMessageEnd();
1731 ankur.sing 971
        getSuccessfulPaymentsAmountRange_result result = new getSuccessfulPaymentsAmountRange_result();
972
        result.success = iface_.getSuccessfulPaymentsAmountRange();
973
        oprot.writeMessageBegin(new TMessage("getSuccessfulPaymentsAmountRange", TMessageType.REPLY, seqid));
1629 ankur.sing 974
        result.write(oprot);
975
        oprot.writeMessageEnd();
976
        oprot.getTransport().flush();
977
      }
978
 
979
    }
980
 
2462 chandransh 981
    private class updateAndCaptureEbsPayment implements ProcessFunction {
982
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
983
      {
984
        updateAndCaptureEbsPayment_args args = new updateAndCaptureEbsPayment_args();
985
        args.read(iprot);
986
        iprot.readMessageEnd();
987
        updateAndCaptureEbsPayment_result result = new updateAndCaptureEbsPayment_result();
988
        try {
989
          result.success = iface_.updateAndCaptureEbsPayment(args.paymentParams);
990
        } catch (PaymentException pe) {
991
          result.pe = pe;
992
        } catch (Throwable th) {
993
          LOGGER.error("Internal error processing updateAndCaptureEbsPayment", th);
994
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing updateAndCaptureEbsPayment");
995
          oprot.writeMessageBegin(new TMessage("updateAndCaptureEbsPayment", TMessageType.EXCEPTION, seqid));
996
          x.write(oprot);
997
          oprot.writeMessageEnd();
998
          oprot.getTransport().flush();
999
          return;
1000
        }
1001
        oprot.writeMessageBegin(new TMessage("updateAndCaptureEbsPayment", TMessageType.REPLY, seqid));
1002
        result.write(oprot);
1003
        oprot.writeMessageEnd();
1004
        oprot.getTransport().flush();
1005
      }
1006
 
1007
    }
1008
 
2708 chandransh 1009
    private class captureEbsPayment implements ProcessFunction {
1010
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
1011
      {
1012
        captureEbsPayment_args args = new captureEbsPayment_args();
1013
        args.read(iprot);
1014
        iprot.readMessageEnd();
1015
        captureEbsPayment_result result = new captureEbsPayment_result();
1016
        try {
1017
          result.success = iface_.captureEbsPayment(args.merchantPaymentId);
1018
        } catch (PaymentException pe) {
1019
          result.pe = pe;
1020
        } catch (Throwable th) {
1021
          LOGGER.error("Internal error processing captureEbsPayment", th);
1022
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing captureEbsPayment");
1023
          oprot.writeMessageBegin(new TMessage("captureEbsPayment", TMessageType.EXCEPTION, seqid));
1024
          x.write(oprot);
1025
          oprot.writeMessageEnd();
1026
          oprot.getTransport().flush();
1027
          return;
1028
        }
1029
        oprot.writeMessageBegin(new TMessage("captureEbsPayment", TMessageType.REPLY, seqid));
1030
        result.write(oprot);
1031
        oprot.writeMessageEnd();
1032
        oprot.getTransport().flush();
1033
      }
1034
 
1035
    }
1036
 
2462 chandransh 1037
    private class captureHdfcPayment implements ProcessFunction {
1038
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
1039
      {
1040
        captureHdfcPayment_args args = new captureHdfcPayment_args();
1041
        args.read(iprot);
1042
        iprot.readMessageEnd();
1043
        captureHdfcPayment_result result = new captureHdfcPayment_result();
1044
        try {
1045
          result.success = iface_.captureHdfcPayment(args.merchantPaymentId);
1046
        } catch (PaymentException pe) {
1047
          result.pe = pe;
1048
        } catch (Throwable th) {
1049
          LOGGER.error("Internal error processing captureHdfcPayment", th);
1050
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing captureHdfcPayment");
1051
          oprot.writeMessageBegin(new TMessage("captureHdfcPayment", TMessageType.EXCEPTION, seqid));
1052
          x.write(oprot);
1053
          oprot.writeMessageEnd();
1054
          oprot.getTransport().flush();
1055
          return;
1056
        }
1057
        oprot.writeMessageBegin(new TMessage("captureHdfcPayment", TMessageType.REPLY, seqid));
1058
        result.write(oprot);
1059
        oprot.writeMessageEnd();
1060
        oprot.getTransport().flush();
1061
      }
1062
 
1063
    }
1064
 
1065
    private class initializeHdfcPayment implements ProcessFunction {
1066
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
1067
      {
1068
        initializeHdfcPayment_args args = new initializeHdfcPayment_args();
1069
        args.read(iprot);
1070
        iprot.readMessageEnd();
1071
        initializeHdfcPayment_result result = new initializeHdfcPayment_result();
1072
        try {
1073
          result.success = iface_.initializeHdfcPayment(args.merchantPaymentId);
1074
        } catch (PaymentException pe) {
1075
          result.pe = pe;
1076
        } catch (Throwable th) {
1077
          LOGGER.error("Internal error processing initializeHdfcPayment", th);
1078
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing initializeHdfcPayment");
1079
          oprot.writeMessageBegin(new TMessage("initializeHdfcPayment", TMessageType.EXCEPTION, seqid));
1080
          x.write(oprot);
1081
          oprot.writeMessageEnd();
1082
          oprot.getTransport().flush();
1083
          return;
1084
        }
1085
        oprot.writeMessageBegin(new TMessage("initializeHdfcPayment", TMessageType.REPLY, seqid));
1086
        result.write(oprot);
1087
        oprot.writeMessageEnd();
1088
        oprot.getTransport().flush();
1089
      }
1090
 
1091
    }
1092
 
2690 chandransh 1093
    private class createRefund implements ProcessFunction {
1094
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
1095
      {
1096
        createRefund_args args = new createRefund_args();
1097
        args.read(iprot);
1098
        iprot.readMessageEnd();
1099
        createRefund_result result = new createRefund_result();
1100
        try {
1101
          result.success = iface_.createRefund(args.orderId, args.merchantTxnId, args.amount);
1102
          result.setSuccessIsSet(true);
1103
        } catch (PaymentException pe) {
1104
          result.pe = pe;
1105
        } catch (Throwable th) {
1106
          LOGGER.error("Internal error processing createRefund", th);
1107
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing createRefund");
1108
          oprot.writeMessageBegin(new TMessage("createRefund", TMessageType.EXCEPTION, seqid));
1109
          x.write(oprot);
1110
          oprot.writeMessageEnd();
1111
          oprot.getTransport().flush();
1112
          return;
1113
        }
1114
        oprot.writeMessageBegin(new TMessage("createRefund", TMessageType.REPLY, seqid));
1115
        result.write(oprot);
1116
        oprot.writeMessageEnd();
1117
        oprot.getTransport().flush();
1118
      }
1119
 
1120
    }
1121
 
123 ashish 1122
  }
1123
 
764 rajveer 1124
  public static class closeSession_args implements TBase<closeSession_args._Fields>, java.io.Serializable, Cloneable, Comparable<closeSession_args>   {
1125
    private static final TStruct STRUCT_DESC = new TStruct("closeSession_args");
1126
 
1127
 
1128
 
1129
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
1130
    public enum _Fields implements TFieldIdEnum {
1131
;
1132
 
1133
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
1134
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
1135
 
1136
      static {
1137
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
1138
          byId.put((int)field._thriftId, field);
1139
          byName.put(field.getFieldName(), field);
1140
        }
1141
      }
1142
 
1143
      /**
1144
       * Find the _Fields constant that matches fieldId, or null if its not found.
1145
       */
1146
      public static _Fields findByThriftId(int fieldId) {
1147
        return byId.get(fieldId);
1148
      }
1149
 
1150
      /**
1151
       * Find the _Fields constant that matches fieldId, throwing an exception
1152
       * if it is not found.
1153
       */
1154
      public static _Fields findByThriftIdOrThrow(int fieldId) {
1155
        _Fields fields = findByThriftId(fieldId);
1156
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
1157
        return fields;
1158
      }
1159
 
1160
      /**
1161
       * Find the _Fields constant that matches name, or null if its not found.
1162
       */
1163
      public static _Fields findByName(String name) {
1164
        return byName.get(name);
1165
      }
1166
 
1167
      private final short _thriftId;
1168
      private final String _fieldName;
1169
 
1170
      _Fields(short thriftId, String fieldName) {
1171
        _thriftId = thriftId;
1172
        _fieldName = fieldName;
1173
      }
1174
 
1175
      public short getThriftFieldId() {
1176
        return _thriftId;
1177
      }
1178
 
1179
      public String getFieldName() {
1180
        return _fieldName;
1181
      }
1182
    }
1183
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
1184
    }});
1185
 
1186
    static {
1187
      FieldMetaData.addStructMetaDataMap(closeSession_args.class, metaDataMap);
1188
    }
1189
 
1190
    public closeSession_args() {
1191
    }
1192
 
1193
    /**
1194
     * Performs a deep copy on <i>other</i>.
1195
     */
1196
    public closeSession_args(closeSession_args other) {
1197
    }
1198
 
1199
    public closeSession_args deepCopy() {
1200
      return new closeSession_args(this);
1201
    }
1202
 
1203
    @Deprecated
1204
    public closeSession_args clone() {
1205
      return new closeSession_args(this);
1206
    }
1207
 
1208
    public void setFieldValue(_Fields field, Object value) {
1209
      switch (field) {
1210
      }
1211
    }
1212
 
1213
    public void setFieldValue(int fieldID, Object value) {
1214
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
1215
    }
1216
 
1217
    public Object getFieldValue(_Fields field) {
1218
      switch (field) {
1219
      }
1220
      throw new IllegalStateException();
1221
    }
1222
 
1223
    public Object getFieldValue(int fieldId) {
1224
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
1225
    }
1226
 
1227
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
1228
    public boolean isSet(_Fields field) {
1229
      switch (field) {
1230
      }
1231
      throw new IllegalStateException();
1232
    }
1233
 
1234
    public boolean isSet(int fieldID) {
1235
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
1236
    }
1237
 
1238
    @Override
1239
    public boolean equals(Object that) {
1240
      if (that == null)
1241
        return false;
1242
      if (that instanceof closeSession_args)
1243
        return this.equals((closeSession_args)that);
1244
      return false;
1245
    }
1246
 
1247
    public boolean equals(closeSession_args that) {
1248
      if (that == null)
1249
        return false;
1250
 
1251
      return true;
1252
    }
1253
 
1254
    @Override
1255
    public int hashCode() {
1256
      return 0;
1257
    }
1258
 
1259
    public int compareTo(closeSession_args other) {
1260
      if (!getClass().equals(other.getClass())) {
1261
        return getClass().getName().compareTo(other.getClass().getName());
1262
      }
1263
 
1264
      int lastComparison = 0;
1265
      closeSession_args typedOther = (closeSession_args)other;
1266
 
1267
      return 0;
1268
    }
1269
 
1270
    public void read(TProtocol iprot) throws TException {
1271
      TField field;
1272
      iprot.readStructBegin();
1273
      while (true)
1274
      {
1275
        field = iprot.readFieldBegin();
1276
        if (field.type == TType.STOP) { 
1277
          break;
1278
        }
1279
        _Fields fieldId = _Fields.findByThriftId(field.id);
1280
        if (fieldId == null) {
1281
          TProtocolUtil.skip(iprot, field.type);
1282
        } else {
1283
          switch (fieldId) {
1284
          }
1285
          iprot.readFieldEnd();
1286
        }
1287
      }
1288
      iprot.readStructEnd();
1289
      validate();
1290
    }
1291
 
1292
    public void write(TProtocol oprot) throws TException {
1293
      validate();
1294
 
1295
      oprot.writeStructBegin(STRUCT_DESC);
1296
      oprot.writeFieldStop();
1297
      oprot.writeStructEnd();
1298
    }
1299
 
1300
    @Override
1301
    public String toString() {
1302
      StringBuilder sb = new StringBuilder("closeSession_args(");
1303
      boolean first = true;
1304
 
1305
      sb.append(")");
1306
      return sb.toString();
1307
    }
1308
 
1309
    public void validate() throws TException {
1310
      // check for required fields
1311
    }
1312
 
1313
  }
1314
 
1315
  public static class closeSession_result implements TBase<closeSession_result._Fields>, java.io.Serializable, Cloneable, Comparable<closeSession_result>   {
1316
    private static final TStruct STRUCT_DESC = new TStruct("closeSession_result");
1317
 
1318
 
1319
 
1320
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
1321
    public enum _Fields implements TFieldIdEnum {
1322
;
1323
 
1324
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
1325
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
1326
 
1327
      static {
1328
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
1329
          byId.put((int)field._thriftId, field);
1330
          byName.put(field.getFieldName(), field);
1331
        }
1332
      }
1333
 
1334
      /**
1335
       * Find the _Fields constant that matches fieldId, or null if its not found.
1336
       */
1337
      public static _Fields findByThriftId(int fieldId) {
1338
        return byId.get(fieldId);
1339
      }
1340
 
1341
      /**
1342
       * Find the _Fields constant that matches fieldId, throwing an exception
1343
       * if it is not found.
1344
       */
1345
      public static _Fields findByThriftIdOrThrow(int fieldId) {
1346
        _Fields fields = findByThriftId(fieldId);
1347
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
1348
        return fields;
1349
      }
1350
 
1351
      /**
1352
       * Find the _Fields constant that matches name, or null if its not found.
1353
       */
1354
      public static _Fields findByName(String name) {
1355
        return byName.get(name);
1356
      }
1357
 
1358
      private final short _thriftId;
1359
      private final String _fieldName;
1360
 
1361
      _Fields(short thriftId, String fieldName) {
1362
        _thriftId = thriftId;
1363
        _fieldName = fieldName;
1364
      }
1365
 
1366
      public short getThriftFieldId() {
1367
        return _thriftId;
1368
      }
1369
 
1370
      public String getFieldName() {
1371
        return _fieldName;
1372
      }
1373
    }
1374
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
1375
    }});
1376
 
1377
    static {
1378
      FieldMetaData.addStructMetaDataMap(closeSession_result.class, metaDataMap);
1379
    }
1380
 
1381
    public closeSession_result() {
1382
    }
1383
 
1384
    /**
1385
     * Performs a deep copy on <i>other</i>.
1386
     */
1387
    public closeSession_result(closeSession_result other) {
1388
    }
1389
 
1390
    public closeSession_result deepCopy() {
1391
      return new closeSession_result(this);
1392
    }
1393
 
1394
    @Deprecated
1395
    public closeSession_result clone() {
1396
      return new closeSession_result(this);
1397
    }
1398
 
1399
    public void setFieldValue(_Fields field, Object value) {
1400
      switch (field) {
1401
      }
1402
    }
1403
 
1404
    public void setFieldValue(int fieldID, Object value) {
1405
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
1406
    }
1407
 
1408
    public Object getFieldValue(_Fields field) {
1409
      switch (field) {
1410
      }
1411
      throw new IllegalStateException();
1412
    }
1413
 
1414
    public Object getFieldValue(int fieldId) {
1415
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
1416
    }
1417
 
1418
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
1419
    public boolean isSet(_Fields field) {
1420
      switch (field) {
1421
      }
1422
      throw new IllegalStateException();
1423
    }
1424
 
1425
    public boolean isSet(int fieldID) {
1426
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
1427
    }
1428
 
1429
    @Override
1430
    public boolean equals(Object that) {
1431
      if (that == null)
1432
        return false;
1433
      if (that instanceof closeSession_result)
1434
        return this.equals((closeSession_result)that);
1435
      return false;
1436
    }
1437
 
1438
    public boolean equals(closeSession_result that) {
1439
      if (that == null)
1440
        return false;
1441
 
1442
      return true;
1443
    }
1444
 
1445
    @Override
1446
    public int hashCode() {
1447
      return 0;
1448
    }
1449
 
1450
    public int compareTo(closeSession_result other) {
1451
      if (!getClass().equals(other.getClass())) {
1452
        return getClass().getName().compareTo(other.getClass().getName());
1453
      }
1454
 
1455
      int lastComparison = 0;
1456
      closeSession_result typedOther = (closeSession_result)other;
1457
 
1458
      return 0;
1459
    }
1460
 
1461
    public void read(TProtocol iprot) throws TException {
1462
      TField field;
1463
      iprot.readStructBegin();
1464
      while (true)
1465
      {
1466
        field = iprot.readFieldBegin();
1467
        if (field.type == TType.STOP) { 
1468
          break;
1469
        }
1470
        _Fields fieldId = _Fields.findByThriftId(field.id);
1471
        if (fieldId == null) {
1472
          TProtocolUtil.skip(iprot, field.type);
1473
        } else {
1474
          switch (fieldId) {
1475
          }
1476
          iprot.readFieldEnd();
1477
        }
1478
      }
1479
      iprot.readStructEnd();
1480
      validate();
1481
    }
1482
 
1483
    public void write(TProtocol oprot) throws TException {
1484
      oprot.writeStructBegin(STRUCT_DESC);
1485
 
1486
      oprot.writeFieldStop();
1487
      oprot.writeStructEnd();
1488
    }
1489
 
1490
    @Override
1491
    public String toString() {
1492
      StringBuilder sb = new StringBuilder("closeSession_result(");
1493
      boolean first = true;
1494
 
1495
      sb.append(")");
1496
      return sb.toString();
1497
    }
1498
 
1499
    public void validate() throws TException {
1500
      // check for required fields
1501
    }
1502
 
1503
  }
1504
 
123 ashish 1505
  public static class createPayment_args implements TBase<createPayment_args._Fields>, java.io.Serializable, Cloneable, Comparable<createPayment_args>   {
1506
    private static final TStruct STRUCT_DESC = new TStruct("createPayment_args");
1507
 
695 rajveer 1508
    private static final TField USER_ID_FIELD_DESC = new TField("userId", TType.I64, (short)1);
1509
    private static final TField AMOUNT_FIELD_DESC = new TField("amount", TType.DOUBLE, (short)2);
1510
    private static final TField GATEWAY_ID_FIELD_DESC = new TField("gatewayId", TType.I64, (short)3);
1511
    private static final TField TXN_ID_FIELD_DESC = new TField("txnId", TType.I64, (short)4);
123 ashish 1512
 
695 rajveer 1513
    private long userId;
123 ashish 1514
    private double amount;
695 rajveer 1515
    private long gatewayId;
1516
    private long txnId;
123 ashish 1517
 
1518
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
1519
    public enum _Fields implements TFieldIdEnum {
695 rajveer 1520
      USER_ID((short)1, "userId"),
1521
      AMOUNT((short)2, "amount"),
1522
      GATEWAY_ID((short)3, "gatewayId"),
1523
      TXN_ID((short)4, "txnId");
123 ashish 1524
 
1525
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
1526
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
1527
 
1528
      static {
1529
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
1530
          byId.put((int)field._thriftId, field);
1531
          byName.put(field.getFieldName(), field);
1532
        }
1533
      }
1534
 
1535
      /**
1536
       * Find the _Fields constant that matches fieldId, or null if its not found.
1537
       */
1538
      public static _Fields findByThriftId(int fieldId) {
1539
        return byId.get(fieldId);
1540
      }
1541
 
1542
      /**
1543
       * Find the _Fields constant that matches fieldId, throwing an exception
1544
       * if it is not found.
1545
       */
1546
      public static _Fields findByThriftIdOrThrow(int fieldId) {
1547
        _Fields fields = findByThriftId(fieldId);
1548
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
1549
        return fields;
1550
      }
1551
 
1552
      /**
1553
       * Find the _Fields constant that matches name, or null if its not found.
1554
       */
1555
      public static _Fields findByName(String name) {
1556
        return byName.get(name);
1557
      }
1558
 
1559
      private final short _thriftId;
1560
      private final String _fieldName;
1561
 
1562
      _Fields(short thriftId, String fieldName) {
1563
        _thriftId = thriftId;
1564
        _fieldName = fieldName;
1565
      }
1566
 
1567
      public short getThriftFieldId() {
1568
        return _thriftId;
1569
      }
1570
 
1571
      public String getFieldName() {
1572
        return _fieldName;
1573
      }
1574
    }
1575
 
1576
    // isset id assignments
695 rajveer 1577
    private static final int __USERID_ISSET_ID = 0;
1578
    private static final int __AMOUNT_ISSET_ID = 1;
1579
    private static final int __GATEWAYID_ISSET_ID = 2;
1580
    private static final int __TXNID_ISSET_ID = 3;
420 ashish 1581
    private BitSet __isset_bit_vector = new BitSet(4);
123 ashish 1582
 
1583
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
695 rajveer 1584
      put(_Fields.USER_ID, new FieldMetaData("userId", TFieldRequirementType.DEFAULT, 
123 ashish 1585
          new FieldValueMetaData(TType.I64)));
1586
      put(_Fields.AMOUNT, new FieldMetaData("amount", TFieldRequirementType.DEFAULT, 
1587
          new FieldValueMetaData(TType.DOUBLE)));
695 rajveer 1588
      put(_Fields.GATEWAY_ID, new FieldMetaData("gatewayId", TFieldRequirementType.DEFAULT, 
420 ashish 1589
          new FieldValueMetaData(TType.I64)));
695 rajveer 1590
      put(_Fields.TXN_ID, new FieldMetaData("txnId", TFieldRequirementType.DEFAULT, 
1591
          new FieldValueMetaData(TType.I64)));
123 ashish 1592
    }});
1593
 
1594
    static {
1595
      FieldMetaData.addStructMetaDataMap(createPayment_args.class, metaDataMap);
1596
    }
1597
 
1598
    public createPayment_args() {
1599
    }
1600
 
1601
    public createPayment_args(
695 rajveer 1602
      long userId,
123 ashish 1603
      double amount,
695 rajveer 1604
      long gatewayId,
1605
      long txnId)
123 ashish 1606
    {
1607
      this();
695 rajveer 1608
      this.userId = userId;
1609
      setUserIdIsSet(true);
123 ashish 1610
      this.amount = amount;
1611
      setAmountIsSet(true);
695 rajveer 1612
      this.gatewayId = gatewayId;
1613
      setGatewayIdIsSet(true);
1614
      this.txnId = txnId;
1615
      setTxnIdIsSet(true);
123 ashish 1616
    }
1617
 
1618
    /**
1619
     * Performs a deep copy on <i>other</i>.
1620
     */
1621
    public createPayment_args(createPayment_args other) {
1622
      __isset_bit_vector.clear();
1623
      __isset_bit_vector.or(other.__isset_bit_vector);
695 rajveer 1624
      this.userId = other.userId;
123 ashish 1625
      this.amount = other.amount;
695 rajveer 1626
      this.gatewayId = other.gatewayId;
1627
      this.txnId = other.txnId;
123 ashish 1628
    }
1629
 
1630
    public createPayment_args deepCopy() {
1631
      return new createPayment_args(this);
1632
    }
1633
 
1634
    @Deprecated
1635
    public createPayment_args clone() {
1636
      return new createPayment_args(this);
1637
    }
1638
 
695 rajveer 1639
    public long getUserId() {
1640
      return this.userId;
123 ashish 1641
    }
1642
 
695 rajveer 1643
    public createPayment_args setUserId(long userId) {
1644
      this.userId = userId;
1645
      setUserIdIsSet(true);
123 ashish 1646
      return this;
1647
    }
1648
 
695 rajveer 1649
    public void unsetUserId() {
1650
      __isset_bit_vector.clear(__USERID_ISSET_ID);
123 ashish 1651
    }
1652
 
695 rajveer 1653
    /** Returns true if field userId is set (has been asigned a value) and false otherwise */
1654
    public boolean isSetUserId() {
1655
      return __isset_bit_vector.get(__USERID_ISSET_ID);
123 ashish 1656
    }
1657
 
695 rajveer 1658
    public void setUserIdIsSet(boolean value) {
1659
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
123 ashish 1660
    }
1661
 
1662
    public double getAmount() {
1663
      return this.amount;
1664
    }
1665
 
1666
    public createPayment_args setAmount(double amount) {
1667
      this.amount = amount;
1668
      setAmountIsSet(true);
1669
      return this;
1670
    }
1671
 
1672
    public void unsetAmount() {
1673
      __isset_bit_vector.clear(__AMOUNT_ISSET_ID);
1674
    }
1675
 
1676
    /** Returns true if field amount is set (has been asigned a value) and false otherwise */
1677
    public boolean isSetAmount() {
1678
      return __isset_bit_vector.get(__AMOUNT_ISSET_ID);
1679
    }
1680
 
1681
    public void setAmountIsSet(boolean value) {
1682
      __isset_bit_vector.set(__AMOUNT_ISSET_ID, value);
1683
    }
1684
 
695 rajveer 1685
    public long getGatewayId() {
1686
      return this.gatewayId;
123 ashish 1687
    }
1688
 
695 rajveer 1689
    public createPayment_args setGatewayId(long gatewayId) {
1690
      this.gatewayId = gatewayId;
1691
      setGatewayIdIsSet(true);
123 ashish 1692
      return this;
1693
    }
1694
 
695 rajveer 1695
    public void unsetGatewayId() {
1696
      __isset_bit_vector.clear(__GATEWAYID_ISSET_ID);
123 ashish 1697
    }
1698
 
695 rajveer 1699
    /** Returns true if field gatewayId is set (has been asigned a value) and false otherwise */
1700
    public boolean isSetGatewayId() {
1701
      return __isset_bit_vector.get(__GATEWAYID_ISSET_ID);
123 ashish 1702
    }
1703
 
695 rajveer 1704
    public void setGatewayIdIsSet(boolean value) {
1705
      __isset_bit_vector.set(__GATEWAYID_ISSET_ID, value);
123 ashish 1706
    }
1707
 
695 rajveer 1708
    public long getTxnId() {
1709
      return this.txnId;
1710
    }
1711
 
1712
    public createPayment_args setTxnId(long txnId) {
1713
      this.txnId = txnId;
1714
      setTxnIdIsSet(true);
1715
      return this;
1716
    }
1717
 
1718
    public void unsetTxnId() {
1719
      __isset_bit_vector.clear(__TXNID_ISSET_ID);
1720
    }
1721
 
1722
    /** Returns true if field txnId is set (has been asigned a value) and false otherwise */
1723
    public boolean isSetTxnId() {
1724
      return __isset_bit_vector.get(__TXNID_ISSET_ID);
1725
    }
1726
 
1727
    public void setTxnIdIsSet(boolean value) {
1728
      __isset_bit_vector.set(__TXNID_ISSET_ID, value);
1729
    }
1730
 
123 ashish 1731
    public void setFieldValue(_Fields field, Object value) {
1732
      switch (field) {
1733
      case USER_ID:
1734
        if (value == null) {
695 rajveer 1735
          unsetUserId();
123 ashish 1736
        } else {
695 rajveer 1737
          setUserId((Long)value);
123 ashish 1738
        }
1739
        break;
1740
 
695 rajveer 1741
      case AMOUNT:
123 ashish 1742
        if (value == null) {
695 rajveer 1743
          unsetAmount();
123 ashish 1744
        } else {
695 rajveer 1745
          setAmount((Double)value);
123 ashish 1746
        }
1747
        break;
1748
 
695 rajveer 1749
      case GATEWAY_ID:
123 ashish 1750
        if (value == null) {
695 rajveer 1751
          unsetGatewayId();
123 ashish 1752
        } else {
695 rajveer 1753
          setGatewayId((Long)value);
123 ashish 1754
        }
1755
        break;
1756
 
695 rajveer 1757
      case TXN_ID:
123 ashish 1758
        if (value == null) {
695 rajveer 1759
          unsetTxnId();
123 ashish 1760
        } else {
695 rajveer 1761
          setTxnId((Long)value);
123 ashish 1762
        }
1763
        break;
1764
 
1765
      }
1766
    }
1767
 
1768
    public void setFieldValue(int fieldID, Object value) {
1769
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
1770
    }
1771
 
1772
    public Object getFieldValue(_Fields field) {
1773
      switch (field) {
1774
      case USER_ID:
695 rajveer 1775
        return new Long(getUserId());
123 ashish 1776
 
1777
      case AMOUNT:
1778
        return new Double(getAmount());
1779
 
420 ashish 1780
      case GATEWAY_ID:
695 rajveer 1781
        return new Long(getGatewayId());
123 ashish 1782
 
695 rajveer 1783
      case TXN_ID:
1784
        return new Long(getTxnId());
1785
 
123 ashish 1786
      }
1787
      throw new IllegalStateException();
1788
    }
1789
 
1790
    public Object getFieldValue(int fieldId) {
1791
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
1792
    }
1793
 
1794
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
1795
    public boolean isSet(_Fields field) {
1796
      switch (field) {
1797
      case USER_ID:
695 rajveer 1798
        return isSetUserId();
123 ashish 1799
      case AMOUNT:
1800
        return isSetAmount();
420 ashish 1801
      case GATEWAY_ID:
695 rajveer 1802
        return isSetGatewayId();
1803
      case TXN_ID:
1804
        return isSetTxnId();
123 ashish 1805
      }
1806
      throw new IllegalStateException();
1807
    }
1808
 
1809
    public boolean isSet(int fieldID) {
1810
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
1811
    }
1812
 
1813
    @Override
1814
    public boolean equals(Object that) {
1815
      if (that == null)
1816
        return false;
1817
      if (that instanceof createPayment_args)
1818
        return this.equals((createPayment_args)that);
1819
      return false;
1820
    }
1821
 
1822
    public boolean equals(createPayment_args that) {
1823
      if (that == null)
1824
        return false;
1825
 
695 rajveer 1826
      boolean this_present_userId = true;
1827
      boolean that_present_userId = true;
1828
      if (this_present_userId || that_present_userId) {
1829
        if (!(this_present_userId && that_present_userId))
123 ashish 1830
          return false;
695 rajveer 1831
        if (this.userId != that.userId)
123 ashish 1832
          return false;
1833
      }
1834
 
1835
      boolean this_present_amount = true;
1836
      boolean that_present_amount = true;
1837
      if (this_present_amount || that_present_amount) {
1838
        if (!(this_present_amount && that_present_amount))
1839
          return false;
1840
        if (this.amount != that.amount)
1841
          return false;
1842
      }
1843
 
695 rajveer 1844
      boolean this_present_gatewayId = true;
1845
      boolean that_present_gatewayId = true;
1846
      if (this_present_gatewayId || that_present_gatewayId) {
1847
        if (!(this_present_gatewayId && that_present_gatewayId))
123 ashish 1848
          return false;
695 rajveer 1849
        if (this.gatewayId != that.gatewayId)
123 ashish 1850
          return false;
1851
      }
1852
 
695 rajveer 1853
      boolean this_present_txnId = true;
1854
      boolean that_present_txnId = true;
1855
      if (this_present_txnId || that_present_txnId) {
1856
        if (!(this_present_txnId && that_present_txnId))
1857
          return false;
1858
        if (this.txnId != that.txnId)
1859
          return false;
1860
      }
1861
 
123 ashish 1862
      return true;
1863
    }
1864
 
1865
    @Override
1866
    public int hashCode() {
1867
      return 0;
1868
    }
1869
 
1870
    public int compareTo(createPayment_args other) {
1871
      if (!getClass().equals(other.getClass())) {
1872
        return getClass().getName().compareTo(other.getClass().getName());
1873
      }
1874
 
1875
      int lastComparison = 0;
1876
      createPayment_args typedOther = (createPayment_args)other;
1877
 
695 rajveer 1878
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(isSetUserId());
123 ashish 1879
      if (lastComparison != 0) {
1880
        return lastComparison;
1881
      }
695 rajveer 1882
      lastComparison = TBaseHelper.compareTo(userId, typedOther.userId);
123 ashish 1883
      if (lastComparison != 0) {
1884
        return lastComparison;
1885
      }
695 rajveer 1886
      lastComparison = Boolean.valueOf(isSetAmount()).compareTo(isSetAmount());
123 ashish 1887
      if (lastComparison != 0) {
1888
        return lastComparison;
1889
      }
695 rajveer 1890
      lastComparison = TBaseHelper.compareTo(amount, typedOther.amount);
123 ashish 1891
      if (lastComparison != 0) {
1892
        return lastComparison;
1893
      }
695 rajveer 1894
      lastComparison = Boolean.valueOf(isSetGatewayId()).compareTo(isSetGatewayId());
123 ashish 1895
      if (lastComparison != 0) {
1896
        return lastComparison;
1897
      }
695 rajveer 1898
      lastComparison = TBaseHelper.compareTo(gatewayId, typedOther.gatewayId);
123 ashish 1899
      if (lastComparison != 0) {
1900
        return lastComparison;
1901
      }
695 rajveer 1902
      lastComparison = Boolean.valueOf(isSetTxnId()).compareTo(isSetTxnId());
123 ashish 1903
      if (lastComparison != 0) {
1904
        return lastComparison;
1905
      }
695 rajveer 1906
      lastComparison = TBaseHelper.compareTo(txnId, typedOther.txnId);
123 ashish 1907
      if (lastComparison != 0) {
1908
        return lastComparison;
1909
      }
1910
      return 0;
1911
    }
1912
 
1913
    public void read(TProtocol iprot) throws TException {
1914
      TField field;
1915
      iprot.readStructBegin();
1916
      while (true)
1917
      {
1918
        field = iprot.readFieldBegin();
1919
        if (field.type == TType.STOP) { 
1920
          break;
1921
        }
1922
        _Fields fieldId = _Fields.findByThriftId(field.id);
1923
        if (fieldId == null) {
1924
          TProtocolUtil.skip(iprot, field.type);
1925
        } else {
1926
          switch (fieldId) {
1927
            case USER_ID:
1928
              if (field.type == TType.I64) {
695 rajveer 1929
                this.userId = iprot.readI64();
1930
                setUserIdIsSet(true);
123 ashish 1931
              } else { 
1932
                TProtocolUtil.skip(iprot, field.type);
1933
              }
1934
              break;
1935
            case AMOUNT:
1936
              if (field.type == TType.DOUBLE) {
1937
                this.amount = iprot.readDouble();
1938
                setAmountIsSet(true);
1939
              } else { 
1940
                TProtocolUtil.skip(iprot, field.type);
1941
              }
1942
              break;
420 ashish 1943
            case GATEWAY_ID:
1944
              if (field.type == TType.I64) {
695 rajveer 1945
                this.gatewayId = iprot.readI64();
1946
                setGatewayIdIsSet(true);
123 ashish 1947
              } else { 
1948
                TProtocolUtil.skip(iprot, field.type);
1949
              }
1950
              break;
695 rajveer 1951
            case TXN_ID:
1952
              if (field.type == TType.I64) {
1953
                this.txnId = iprot.readI64();
1954
                setTxnIdIsSet(true);
1955
              } else { 
1956
                TProtocolUtil.skip(iprot, field.type);
1957
              }
1958
              break;
123 ashish 1959
          }
1960
          iprot.readFieldEnd();
1961
        }
1962
      }
1963
      iprot.readStructEnd();
1964
      validate();
1965
    }
1966
 
1967
    public void write(TProtocol oprot) throws TException {
1968
      validate();
1969
 
1970
      oprot.writeStructBegin(STRUCT_DESC);
1971
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
695 rajveer 1972
      oprot.writeI64(this.userId);
123 ashish 1973
      oprot.writeFieldEnd();
1974
      oprot.writeFieldBegin(AMOUNT_FIELD_DESC);
1975
      oprot.writeDouble(this.amount);
1976
      oprot.writeFieldEnd();
420 ashish 1977
      oprot.writeFieldBegin(GATEWAY_ID_FIELD_DESC);
695 rajveer 1978
      oprot.writeI64(this.gatewayId);
420 ashish 1979
      oprot.writeFieldEnd();
695 rajveer 1980
      oprot.writeFieldBegin(TXN_ID_FIELD_DESC);
1981
      oprot.writeI64(this.txnId);
1982
      oprot.writeFieldEnd();
123 ashish 1983
      oprot.writeFieldStop();
1984
      oprot.writeStructEnd();
1985
    }
1986
 
1987
    @Override
1988
    public String toString() {
1989
      StringBuilder sb = new StringBuilder("createPayment_args(");
1990
      boolean first = true;
1991
 
695 rajveer 1992
      sb.append("userId:");
1993
      sb.append(this.userId);
123 ashish 1994
      first = false;
1995
      if (!first) sb.append(", ");
1996
      sb.append("amount:");
1997
      sb.append(this.amount);
1998
      first = false;
1999
      if (!first) sb.append(", ");
695 rajveer 2000
      sb.append("gatewayId:");
2001
      sb.append(this.gatewayId);
123 ashish 2002
      first = false;
695 rajveer 2003
      if (!first) sb.append(", ");
2004
      sb.append("txnId:");
2005
      sb.append(this.txnId);
2006
      first = false;
123 ashish 2007
      sb.append(")");
2008
      return sb.toString();
2009
    }
2010
 
2011
    public void validate() throws TException {
2012
      // check for required fields
2013
    }
2014
 
2015
  }
2016
 
420 ashish 2017
  public static class createPayment_result implements TBase<createPayment_result._Fields>, java.io.Serializable, Cloneable, Comparable<createPayment_result>   {
123 ashish 2018
    private static final TStruct STRUCT_DESC = new TStruct("createPayment_result");
2019
 
420 ashish 2020
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.I64, (short)0);
123 ashish 2021
    private static final TField PE_FIELD_DESC = new TField("pe", TType.STRUCT, (short)1);
2022
 
420 ashish 2023
    private long success;
123 ashish 2024
    private PaymentException pe;
2025
 
2026
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
2027
    public enum _Fields implements TFieldIdEnum {
2028
      SUCCESS((short)0, "success"),
2029
      PE((short)1, "pe");
2030
 
2031
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
2032
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2033
 
2034
      static {
2035
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2036
          byId.put((int)field._thriftId, field);
2037
          byName.put(field.getFieldName(), field);
2038
        }
2039
      }
2040
 
2041
      /**
2042
       * Find the _Fields constant that matches fieldId, or null if its not found.
2043
       */
2044
      public static _Fields findByThriftId(int fieldId) {
2045
        return byId.get(fieldId);
2046
      }
2047
 
2048
      /**
2049
       * Find the _Fields constant that matches fieldId, throwing an exception
2050
       * if it is not found.
2051
       */
2052
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2053
        _Fields fields = findByThriftId(fieldId);
2054
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2055
        return fields;
2056
      }
2057
 
2058
      /**
2059
       * Find the _Fields constant that matches name, or null if its not found.
2060
       */
2061
      public static _Fields findByName(String name) {
2062
        return byName.get(name);
2063
      }
2064
 
2065
      private final short _thriftId;
2066
      private final String _fieldName;
2067
 
2068
      _Fields(short thriftId, String fieldName) {
2069
        _thriftId = thriftId;
2070
        _fieldName = fieldName;
2071
      }
2072
 
2073
      public short getThriftFieldId() {
2074
        return _thriftId;
2075
      }
2076
 
2077
      public String getFieldName() {
2078
        return _fieldName;
2079
      }
2080
    }
2081
 
2082
    // isset id assignments
420 ashish 2083
    private static final int __SUCCESS_ISSET_ID = 0;
2084
    private BitSet __isset_bit_vector = new BitSet(1);
123 ashish 2085
 
2086
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
2087
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
420 ashish 2088
          new FieldValueMetaData(TType.I64)));
123 ashish 2089
      put(_Fields.PE, new FieldMetaData("pe", TFieldRequirementType.DEFAULT, 
2090
          new FieldValueMetaData(TType.STRUCT)));
2091
    }});
2092
 
2093
    static {
2094
      FieldMetaData.addStructMetaDataMap(createPayment_result.class, metaDataMap);
2095
    }
2096
 
2097
    public createPayment_result() {
2098
    }
2099
 
2100
    public createPayment_result(
420 ashish 2101
      long success,
123 ashish 2102
      PaymentException pe)
2103
    {
2104
      this();
2105
      this.success = success;
420 ashish 2106
      setSuccessIsSet(true);
123 ashish 2107
      this.pe = pe;
2108
    }
2109
 
2110
    /**
2111
     * Performs a deep copy on <i>other</i>.
2112
     */
2113
    public createPayment_result(createPayment_result other) {
420 ashish 2114
      __isset_bit_vector.clear();
2115
      __isset_bit_vector.or(other.__isset_bit_vector);
2116
      this.success = other.success;
123 ashish 2117
      if (other.isSetPe()) {
2118
        this.pe = new PaymentException(other.pe);
2119
      }
2120
    }
2121
 
2122
    public createPayment_result deepCopy() {
2123
      return new createPayment_result(this);
2124
    }
2125
 
2126
    @Deprecated
2127
    public createPayment_result clone() {
2128
      return new createPayment_result(this);
2129
    }
2130
 
420 ashish 2131
    public long getSuccess() {
123 ashish 2132
      return this.success;
2133
    }
2134
 
420 ashish 2135
    public createPayment_result setSuccess(long success) {
123 ashish 2136
      this.success = success;
420 ashish 2137
      setSuccessIsSet(true);
123 ashish 2138
      return this;
2139
    }
2140
 
2141
    public void unsetSuccess() {
420 ashish 2142
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
123 ashish 2143
    }
2144
 
2145
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
2146
    public boolean isSetSuccess() {
420 ashish 2147
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
123 ashish 2148
    }
2149
 
2150
    public void setSuccessIsSet(boolean value) {
420 ashish 2151
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
123 ashish 2152
    }
2153
 
2154
    public PaymentException getPe() {
2155
      return this.pe;
2156
    }
2157
 
2158
    public createPayment_result setPe(PaymentException pe) {
2159
      this.pe = pe;
2160
      return this;
2161
    }
2162
 
2163
    public void unsetPe() {
2164
      this.pe = null;
2165
    }
2166
 
2167
    /** Returns true if field pe is set (has been asigned a value) and false otherwise */
2168
    public boolean isSetPe() {
2169
      return this.pe != null;
2170
    }
2171
 
2172
    public void setPeIsSet(boolean value) {
2173
      if (!value) {
2174
        this.pe = null;
2175
      }
2176
    }
2177
 
2178
    public void setFieldValue(_Fields field, Object value) {
2179
      switch (field) {
2180
      case SUCCESS:
2181
        if (value == null) {
2182
          unsetSuccess();
2183
        } else {
420 ashish 2184
          setSuccess((Long)value);
123 ashish 2185
        }
2186
        break;
2187
 
2188
      case PE:
2189
        if (value == null) {
2190
          unsetPe();
2191
        } else {
2192
          setPe((PaymentException)value);
2193
        }
2194
        break;
2195
 
2196
      }
2197
    }
2198
 
2199
    public void setFieldValue(int fieldID, Object value) {
2200
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
2201
    }
2202
 
2203
    public Object getFieldValue(_Fields field) {
2204
      switch (field) {
2205
      case SUCCESS:
420 ashish 2206
        return new Long(getSuccess());
123 ashish 2207
 
2208
      case PE:
2209
        return getPe();
2210
 
2211
      }
2212
      throw new IllegalStateException();
2213
    }
2214
 
2215
    public Object getFieldValue(int fieldId) {
2216
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
2217
    }
2218
 
2219
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
2220
    public boolean isSet(_Fields field) {
2221
      switch (field) {
2222
      case SUCCESS:
2223
        return isSetSuccess();
2224
      case PE:
2225
        return isSetPe();
2226
      }
2227
      throw new IllegalStateException();
2228
    }
2229
 
2230
    public boolean isSet(int fieldID) {
2231
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
2232
    }
2233
 
2234
    @Override
2235
    public boolean equals(Object that) {
2236
      if (that == null)
2237
        return false;
2238
      if (that instanceof createPayment_result)
2239
        return this.equals((createPayment_result)that);
2240
      return false;
2241
    }
2242
 
2243
    public boolean equals(createPayment_result that) {
2244
      if (that == null)
2245
        return false;
2246
 
420 ashish 2247
      boolean this_present_success = true;
2248
      boolean that_present_success = true;
123 ashish 2249
      if (this_present_success || that_present_success) {
2250
        if (!(this_present_success && that_present_success))
2251
          return false;
420 ashish 2252
        if (this.success != that.success)
123 ashish 2253
          return false;
2254
      }
2255
 
2256
      boolean this_present_pe = true && this.isSetPe();
2257
      boolean that_present_pe = true && that.isSetPe();
2258
      if (this_present_pe || that_present_pe) {
2259
        if (!(this_present_pe && that_present_pe))
2260
          return false;
2261
        if (!this.pe.equals(that.pe))
2262
          return false;
2263
      }
2264
 
2265
      return true;
2266
    }
2267
 
2268
    @Override
2269
    public int hashCode() {
2270
      return 0;
2271
    }
2272
 
420 ashish 2273
    public int compareTo(createPayment_result other) {
2274
      if (!getClass().equals(other.getClass())) {
2275
        return getClass().getName().compareTo(other.getClass().getName());
2276
      }
2277
 
2278
      int lastComparison = 0;
2279
      createPayment_result typedOther = (createPayment_result)other;
2280
 
2281
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
2282
      if (lastComparison != 0) {
2283
        return lastComparison;
2284
      }
2285
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
2286
      if (lastComparison != 0) {
2287
        return lastComparison;
2288
      }
2289
      lastComparison = Boolean.valueOf(isSetPe()).compareTo(isSetPe());
2290
      if (lastComparison != 0) {
2291
        return lastComparison;
2292
      }
2293
      lastComparison = TBaseHelper.compareTo(pe, typedOther.pe);
2294
      if (lastComparison != 0) {
2295
        return lastComparison;
2296
      }
2297
      return 0;
2298
    }
2299
 
123 ashish 2300
    public void read(TProtocol iprot) throws TException {
2301
      TField field;
2302
      iprot.readStructBegin();
2303
      while (true)
2304
      {
2305
        field = iprot.readFieldBegin();
2306
        if (field.type == TType.STOP) { 
2307
          break;
2308
        }
2309
        _Fields fieldId = _Fields.findByThriftId(field.id);
2310
        if (fieldId == null) {
2311
          TProtocolUtil.skip(iprot, field.type);
2312
        } else {
2313
          switch (fieldId) {
2314
            case SUCCESS:
420 ashish 2315
              if (field.type == TType.I64) {
2316
                this.success = iprot.readI64();
2317
                setSuccessIsSet(true);
123 ashish 2318
              } else { 
2319
                TProtocolUtil.skip(iprot, field.type);
2320
              }
2321
              break;
2322
            case PE:
2323
              if (field.type == TType.STRUCT) {
2324
                this.pe = new PaymentException();
2325
                this.pe.read(iprot);
2326
              } else { 
2327
                TProtocolUtil.skip(iprot, field.type);
2328
              }
2329
              break;
2330
          }
2331
          iprot.readFieldEnd();
2332
        }
2333
      }
2334
      iprot.readStructEnd();
2335
      validate();
2336
    }
2337
 
2338
    public void write(TProtocol oprot) throws TException {
2339
      oprot.writeStructBegin(STRUCT_DESC);
2340
 
2341
      if (this.isSetSuccess()) {
2342
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
420 ashish 2343
        oprot.writeI64(this.success);
123 ashish 2344
        oprot.writeFieldEnd();
2345
      } else if (this.isSetPe()) {
2346
        oprot.writeFieldBegin(PE_FIELD_DESC);
2347
        this.pe.write(oprot);
2348
        oprot.writeFieldEnd();
2349
      }
2350
      oprot.writeFieldStop();
2351
      oprot.writeStructEnd();
2352
    }
2353
 
2354
    @Override
2355
    public String toString() {
2356
      StringBuilder sb = new StringBuilder("createPayment_result(");
2357
      boolean first = true;
2358
 
2359
      sb.append("success:");
420 ashish 2360
      sb.append(this.success);
123 ashish 2361
      first = false;
2362
      if (!first) sb.append(", ");
2363
      sb.append("pe:");
2364
      if (this.pe == null) {
2365
        sb.append("null");
2366
      } else {
2367
        sb.append(this.pe);
2368
      }
2369
      first = false;
2370
      sb.append(")");
2371
      return sb.toString();
2372
    }
2373
 
2374
    public void validate() throws TException {
2375
      // check for required fields
2376
    }
2377
 
2378
  }
2379
 
2380
  public static class getPaymentsForUser_args implements TBase<getPaymentsForUser_args._Fields>, java.io.Serializable, Cloneable, Comparable<getPaymentsForUser_args>   {
2381
    private static final TStruct STRUCT_DESC = new TStruct("getPaymentsForUser_args");
2382
 
2383
    private static final TField USER_ID_FIELD_DESC = new TField("userId", TType.I64, (short)1);
695 rajveer 2384
    private static final TField FROM_TIME_FIELD_DESC = new TField("fromTime", TType.I64, (short)2);
2385
    private static final TField TO_TIME_FIELD_DESC = new TField("toTime", TType.I64, (short)3);
123 ashish 2386
    private static final TField STATUS_FIELD_DESC = new TField("status", TType.I32, (short)4);
695 rajveer 2387
    private static final TField GATEWAY_ID_FIELD_DESC = new TField("gatewayId", TType.I64, (short)5);
123 ashish 2388
 
2389
    private long userId;
695 rajveer 2390
    private long fromTime;
2391
    private long toTime;
123 ashish 2392
    private PaymentStatus status;
695 rajveer 2393
    private long gatewayId;
123 ashish 2394
 
2395
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
2396
    public enum _Fields implements TFieldIdEnum {
2397
      USER_ID((short)1, "userId"),
695 rajveer 2398
      FROM_TIME((short)2, "fromTime"),
2399
      TO_TIME((short)3, "toTime"),
123 ashish 2400
      /**
2401
       * 
2402
       * @see PaymentStatus
2403
       */
2404
      STATUS((short)4, "status"),
695 rajveer 2405
      GATEWAY_ID((short)5, "gatewayId");
123 ashish 2406
 
2407
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
2408
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2409
 
2410
      static {
2411
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2412
          byId.put((int)field._thriftId, field);
2413
          byName.put(field.getFieldName(), field);
2414
        }
2415
      }
2416
 
2417
      /**
2418
       * Find the _Fields constant that matches fieldId, or null if its not found.
2419
       */
2420
      public static _Fields findByThriftId(int fieldId) {
2421
        return byId.get(fieldId);
2422
      }
2423
 
2424
      /**
2425
       * Find the _Fields constant that matches fieldId, throwing an exception
2426
       * if it is not found.
2427
       */
2428
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2429
        _Fields fields = findByThriftId(fieldId);
2430
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2431
        return fields;
2432
      }
2433
 
2434
      /**
2435
       * Find the _Fields constant that matches name, or null if its not found.
2436
       */
2437
      public static _Fields findByName(String name) {
2438
        return byName.get(name);
2439
      }
2440
 
2441
      private final short _thriftId;
2442
      private final String _fieldName;
2443
 
2444
      _Fields(short thriftId, String fieldName) {
2445
        _thriftId = thriftId;
2446
        _fieldName = fieldName;
2447
      }
2448
 
2449
      public short getThriftFieldId() {
2450
        return _thriftId;
2451
      }
2452
 
2453
      public String getFieldName() {
2454
        return _fieldName;
2455
      }
2456
    }
2457
 
2458
    // isset id assignments
2459
    private static final int __USERID_ISSET_ID = 0;
695 rajveer 2460
    private static final int __FROMTIME_ISSET_ID = 1;
2461
    private static final int __TOTIME_ISSET_ID = 2;
2462
    private static final int __GATEWAYID_ISSET_ID = 3;
420 ashish 2463
    private BitSet __isset_bit_vector = new BitSet(4);
123 ashish 2464
 
2465
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
2466
      put(_Fields.USER_ID, new FieldMetaData("userId", TFieldRequirementType.DEFAULT, 
2467
          new FieldValueMetaData(TType.I64)));
695 rajveer 2468
      put(_Fields.FROM_TIME, new FieldMetaData("fromTime", TFieldRequirementType.DEFAULT, 
123 ashish 2469
          new FieldValueMetaData(TType.I64)));
695 rajveer 2470
      put(_Fields.TO_TIME, new FieldMetaData("toTime", TFieldRequirementType.DEFAULT, 
123 ashish 2471
          new FieldValueMetaData(TType.I64)));
2472
      put(_Fields.STATUS, new FieldMetaData("status", TFieldRequirementType.DEFAULT, 
2473
          new EnumMetaData(TType.ENUM, PaymentStatus.class)));
695 rajveer 2474
      put(_Fields.GATEWAY_ID, new FieldMetaData("gatewayId", TFieldRequirementType.DEFAULT, 
420 ashish 2475
          new FieldValueMetaData(TType.I64)));
123 ashish 2476
    }});
2477
 
2478
    static {
2479
      FieldMetaData.addStructMetaDataMap(getPaymentsForUser_args.class, metaDataMap);
2480
    }
2481
 
2482
    public getPaymentsForUser_args() {
2483
    }
2484
 
2485
    public getPaymentsForUser_args(
2486
      long userId,
695 rajveer 2487
      long fromTime,
2488
      long toTime,
123 ashish 2489
      PaymentStatus status,
695 rajveer 2490
      long gatewayId)
123 ashish 2491
    {
2492
      this();
2493
      this.userId = userId;
2494
      setUserIdIsSet(true);
695 rajveer 2495
      this.fromTime = fromTime;
2496
      setFromTimeIsSet(true);
2497
      this.toTime = toTime;
2498
      setToTimeIsSet(true);
123 ashish 2499
      this.status = status;
695 rajveer 2500
      this.gatewayId = gatewayId;
2501
      setGatewayIdIsSet(true);
123 ashish 2502
    }
2503
 
2504
    /**
2505
     * Performs a deep copy on <i>other</i>.
2506
     */
2507
    public getPaymentsForUser_args(getPaymentsForUser_args other) {
2508
      __isset_bit_vector.clear();
2509
      __isset_bit_vector.or(other.__isset_bit_vector);
2510
      this.userId = other.userId;
695 rajveer 2511
      this.fromTime = other.fromTime;
2512
      this.toTime = other.toTime;
123 ashish 2513
      if (other.isSetStatus()) {
2514
        this.status = other.status;
2515
      }
695 rajveer 2516
      this.gatewayId = other.gatewayId;
123 ashish 2517
    }
2518
 
2519
    public getPaymentsForUser_args deepCopy() {
2520
      return new getPaymentsForUser_args(this);
2521
    }
2522
 
2523
    @Deprecated
2524
    public getPaymentsForUser_args clone() {
2525
      return new getPaymentsForUser_args(this);
2526
    }
2527
 
2528
    public long getUserId() {
2529
      return this.userId;
2530
    }
2531
 
2532
    public getPaymentsForUser_args setUserId(long userId) {
2533
      this.userId = userId;
2534
      setUserIdIsSet(true);
2535
      return this;
2536
    }
2537
 
2538
    public void unsetUserId() {
2539
      __isset_bit_vector.clear(__USERID_ISSET_ID);
2540
    }
2541
 
2542
    /** Returns true if field userId is set (has been asigned a value) and false otherwise */
2543
    public boolean isSetUserId() {
2544
      return __isset_bit_vector.get(__USERID_ISSET_ID);
2545
    }
2546
 
2547
    public void setUserIdIsSet(boolean value) {
2548
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
2549
    }
2550
 
695 rajveer 2551
    public long getFromTime() {
2552
      return this.fromTime;
123 ashish 2553
    }
2554
 
695 rajveer 2555
    public getPaymentsForUser_args setFromTime(long fromTime) {
2556
      this.fromTime = fromTime;
2557
      setFromTimeIsSet(true);
123 ashish 2558
      return this;
2559
    }
2560
 
695 rajveer 2561
    public void unsetFromTime() {
2562
      __isset_bit_vector.clear(__FROMTIME_ISSET_ID);
123 ashish 2563
    }
2564
 
695 rajveer 2565
    /** Returns true if field fromTime is set (has been asigned a value) and false otherwise */
2566
    public boolean isSetFromTime() {
2567
      return __isset_bit_vector.get(__FROMTIME_ISSET_ID);
123 ashish 2568
    }
2569
 
695 rajveer 2570
    public void setFromTimeIsSet(boolean value) {
2571
      __isset_bit_vector.set(__FROMTIME_ISSET_ID, value);
123 ashish 2572
    }
2573
 
695 rajveer 2574
    public long getToTime() {
2575
      return this.toTime;
123 ashish 2576
    }
2577
 
695 rajveer 2578
    public getPaymentsForUser_args setToTime(long toTime) {
2579
      this.toTime = toTime;
2580
      setToTimeIsSet(true);
123 ashish 2581
      return this;
2582
    }
2583
 
695 rajveer 2584
    public void unsetToTime() {
2585
      __isset_bit_vector.clear(__TOTIME_ISSET_ID);
123 ashish 2586
    }
2587
 
695 rajveer 2588
    /** Returns true if field toTime is set (has been asigned a value) and false otherwise */
2589
    public boolean isSetToTime() {
2590
      return __isset_bit_vector.get(__TOTIME_ISSET_ID);
123 ashish 2591
    }
2592
 
695 rajveer 2593
    public void setToTimeIsSet(boolean value) {
2594
      __isset_bit_vector.set(__TOTIME_ISSET_ID, value);
123 ashish 2595
    }
2596
 
2597
    /**
2598
     * 
2599
     * @see PaymentStatus
2600
     */
2601
    public PaymentStatus getStatus() {
2602
      return this.status;
2603
    }
2604
 
2605
    /**
2606
     * 
2607
     * @see PaymentStatus
2608
     */
2609
    public getPaymentsForUser_args setStatus(PaymentStatus status) {
2610
      this.status = status;
2611
      return this;
2612
    }
2613
 
2614
    public void unsetStatus() {
2615
      this.status = null;
2616
    }
2617
 
2618
    /** Returns true if field status is set (has been asigned a value) and false otherwise */
2619
    public boolean isSetStatus() {
2620
      return this.status != null;
2621
    }
2622
 
2623
    public void setStatusIsSet(boolean value) {
2624
      if (!value) {
2625
        this.status = null;
2626
      }
2627
    }
2628
 
695 rajveer 2629
    public long getGatewayId() {
2630
      return this.gatewayId;
123 ashish 2631
    }
2632
 
695 rajveer 2633
    public getPaymentsForUser_args setGatewayId(long gatewayId) {
2634
      this.gatewayId = gatewayId;
2635
      setGatewayIdIsSet(true);
123 ashish 2636
      return this;
2637
    }
2638
 
695 rajveer 2639
    public void unsetGatewayId() {
2640
      __isset_bit_vector.clear(__GATEWAYID_ISSET_ID);
123 ashish 2641
    }
2642
 
695 rajveer 2643
    /** Returns true if field gatewayId is set (has been asigned a value) and false otherwise */
2644
    public boolean isSetGatewayId() {
2645
      return __isset_bit_vector.get(__GATEWAYID_ISSET_ID);
123 ashish 2646
    }
2647
 
695 rajveer 2648
    public void setGatewayIdIsSet(boolean value) {
2649
      __isset_bit_vector.set(__GATEWAYID_ISSET_ID, value);
123 ashish 2650
    }
2651
 
2652
    public void setFieldValue(_Fields field, Object value) {
2653
      switch (field) {
2654
      case USER_ID:
2655
        if (value == null) {
2656
          unsetUserId();
2657
        } else {
2658
          setUserId((Long)value);
2659
        }
2660
        break;
2661
 
2662
      case FROM_TIME:
2663
        if (value == null) {
695 rajveer 2664
          unsetFromTime();
123 ashish 2665
        } else {
695 rajveer 2666
          setFromTime((Long)value);
123 ashish 2667
        }
2668
        break;
2669
 
2670
      case TO_TIME:
2671
        if (value == null) {
695 rajveer 2672
          unsetToTime();
123 ashish 2673
        } else {
695 rajveer 2674
          setToTime((Long)value);
123 ashish 2675
        }
2676
        break;
2677
 
2678
      case STATUS:
2679
        if (value == null) {
2680
          unsetStatus();
2681
        } else {
2682
          setStatus((PaymentStatus)value);
2683
        }
2684
        break;
2685
 
420 ashish 2686
      case GATEWAY_ID:
123 ashish 2687
        if (value == null) {
695 rajveer 2688
          unsetGatewayId();
123 ashish 2689
        } else {
695 rajveer 2690
          setGatewayId((Long)value);
123 ashish 2691
        }
2692
        break;
2693
 
2694
      }
2695
    }
2696
 
2697
    public void setFieldValue(int fieldID, Object value) {
2698
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
2699
    }
2700
 
2701
    public Object getFieldValue(_Fields field) {
2702
      switch (field) {
2703
      case USER_ID:
2704
        return new Long(getUserId());
2705
 
2706
      case FROM_TIME:
695 rajveer 2707
        return new Long(getFromTime());
123 ashish 2708
 
2709
      case TO_TIME:
695 rajveer 2710
        return new Long(getToTime());
123 ashish 2711
 
2712
      case STATUS:
2713
        return getStatus();
2714
 
420 ashish 2715
      case GATEWAY_ID:
695 rajveer 2716
        return new Long(getGatewayId());
123 ashish 2717
 
2718
      }
2719
      throw new IllegalStateException();
2720
    }
2721
 
2722
    public Object getFieldValue(int fieldId) {
2723
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
2724
    }
2725
 
2726
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
2727
    public boolean isSet(_Fields field) {
2728
      switch (field) {
2729
      case USER_ID:
2730
        return isSetUserId();
2731
      case FROM_TIME:
695 rajveer 2732
        return isSetFromTime();
123 ashish 2733
      case TO_TIME:
695 rajveer 2734
        return isSetToTime();
123 ashish 2735
      case STATUS:
2736
        return isSetStatus();
420 ashish 2737
      case GATEWAY_ID:
695 rajveer 2738
        return isSetGatewayId();
123 ashish 2739
      }
2740
      throw new IllegalStateException();
2741
    }
2742
 
2743
    public boolean isSet(int fieldID) {
2744
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
2745
    }
2746
 
2747
    @Override
2748
    public boolean equals(Object that) {
2749
      if (that == null)
2750
        return false;
2751
      if (that instanceof getPaymentsForUser_args)
2752
        return this.equals((getPaymentsForUser_args)that);
2753
      return false;
2754
    }
2755
 
2756
    public boolean equals(getPaymentsForUser_args that) {
2757
      if (that == null)
2758
        return false;
2759
 
2760
      boolean this_present_userId = true;
2761
      boolean that_present_userId = true;
2762
      if (this_present_userId || that_present_userId) {
2763
        if (!(this_present_userId && that_present_userId))
2764
          return false;
2765
        if (this.userId != that.userId)
2766
          return false;
2767
      }
2768
 
695 rajveer 2769
      boolean this_present_fromTime = true;
2770
      boolean that_present_fromTime = true;
2771
      if (this_present_fromTime || that_present_fromTime) {
2772
        if (!(this_present_fromTime && that_present_fromTime))
123 ashish 2773
          return false;
695 rajveer 2774
        if (this.fromTime != that.fromTime)
123 ashish 2775
          return false;
2776
      }
2777
 
695 rajveer 2778
      boolean this_present_toTime = true;
2779
      boolean that_present_toTime = true;
2780
      if (this_present_toTime || that_present_toTime) {
2781
        if (!(this_present_toTime && that_present_toTime))
123 ashish 2782
          return false;
695 rajveer 2783
        if (this.toTime != that.toTime)
123 ashish 2784
          return false;
2785
      }
2786
 
2787
      boolean this_present_status = true && this.isSetStatus();
2788
      boolean that_present_status = true && that.isSetStatus();
2789
      if (this_present_status || that_present_status) {
2790
        if (!(this_present_status && that_present_status))
2791
          return false;
2792
        if (!this.status.equals(that.status))
2793
          return false;
2794
      }
2795
 
695 rajveer 2796
      boolean this_present_gatewayId = true;
2797
      boolean that_present_gatewayId = true;
2798
      if (this_present_gatewayId || that_present_gatewayId) {
2799
        if (!(this_present_gatewayId && that_present_gatewayId))
123 ashish 2800
          return false;
695 rajveer 2801
        if (this.gatewayId != that.gatewayId)
123 ashish 2802
          return false;
2803
      }
2804
 
2805
      return true;
2806
    }
2807
 
2808
    @Override
2809
    public int hashCode() {
2810
      return 0;
2811
    }
2812
 
2813
    public int compareTo(getPaymentsForUser_args other) {
2814
      if (!getClass().equals(other.getClass())) {
2815
        return getClass().getName().compareTo(other.getClass().getName());
2816
      }
2817
 
2818
      int lastComparison = 0;
2819
      getPaymentsForUser_args typedOther = (getPaymentsForUser_args)other;
2820
 
2821
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(isSetUserId());
2822
      if (lastComparison != 0) {
2823
        return lastComparison;
2824
      }
2825
      lastComparison = TBaseHelper.compareTo(userId, typedOther.userId);
2826
      if (lastComparison != 0) {
2827
        return lastComparison;
2828
      }
695 rajveer 2829
      lastComparison = Boolean.valueOf(isSetFromTime()).compareTo(isSetFromTime());
123 ashish 2830
      if (lastComparison != 0) {
2831
        return lastComparison;
2832
      }
695 rajveer 2833
      lastComparison = TBaseHelper.compareTo(fromTime, typedOther.fromTime);
123 ashish 2834
      if (lastComparison != 0) {
2835
        return lastComparison;
2836
      }
695 rajveer 2837
      lastComparison = Boolean.valueOf(isSetToTime()).compareTo(isSetToTime());
123 ashish 2838
      if (lastComparison != 0) {
2839
        return lastComparison;
2840
      }
695 rajveer 2841
      lastComparison = TBaseHelper.compareTo(toTime, typedOther.toTime);
123 ashish 2842
      if (lastComparison != 0) {
2843
        return lastComparison;
2844
      }
2845
      lastComparison = Boolean.valueOf(isSetStatus()).compareTo(isSetStatus());
2846
      if (lastComparison != 0) {
2847
        return lastComparison;
2848
      }
2849
      lastComparison = TBaseHelper.compareTo(status, typedOther.status);
2850
      if (lastComparison != 0) {
2851
        return lastComparison;
2852
      }
695 rajveer 2853
      lastComparison = Boolean.valueOf(isSetGatewayId()).compareTo(isSetGatewayId());
123 ashish 2854
      if (lastComparison != 0) {
2855
        return lastComparison;
2856
      }
695 rajveer 2857
      lastComparison = TBaseHelper.compareTo(gatewayId, typedOther.gatewayId);
123 ashish 2858
      if (lastComparison != 0) {
2859
        return lastComparison;
2860
      }
2861
      return 0;
2862
    }
2863
 
2864
    public void read(TProtocol iprot) throws TException {
2865
      TField field;
2866
      iprot.readStructBegin();
2867
      while (true)
2868
      {
2869
        field = iprot.readFieldBegin();
2870
        if (field.type == TType.STOP) { 
2871
          break;
2872
        }
2873
        _Fields fieldId = _Fields.findByThriftId(field.id);
2874
        if (fieldId == null) {
2875
          TProtocolUtil.skip(iprot, field.type);
2876
        } else {
2877
          switch (fieldId) {
2878
            case USER_ID:
2879
              if (field.type == TType.I64) {
2880
                this.userId = iprot.readI64();
2881
                setUserIdIsSet(true);
2882
              } else { 
2883
                TProtocolUtil.skip(iprot, field.type);
2884
              }
2885
              break;
2886
            case FROM_TIME:
2887
              if (field.type == TType.I64) {
695 rajveer 2888
                this.fromTime = iprot.readI64();
2889
                setFromTimeIsSet(true);
123 ashish 2890
              } else { 
2891
                TProtocolUtil.skip(iprot, field.type);
2892
              }
2893
              break;
2894
            case TO_TIME:
2895
              if (field.type == TType.I64) {
695 rajveer 2896
                this.toTime = iprot.readI64();
2897
                setToTimeIsSet(true);
123 ashish 2898
              } else { 
2899
                TProtocolUtil.skip(iprot, field.type);
2900
              }
2901
              break;
2902
            case STATUS:
2903
              if (field.type == TType.I32) {
2904
                this.status = PaymentStatus.findByValue(iprot.readI32());
2905
              } else { 
2906
                TProtocolUtil.skip(iprot, field.type);
2907
              }
2908
              break;
420 ashish 2909
            case GATEWAY_ID:
2910
              if (field.type == TType.I64) {
695 rajveer 2911
                this.gatewayId = iprot.readI64();
2912
                setGatewayIdIsSet(true);
123 ashish 2913
              } else { 
2914
                TProtocolUtil.skip(iprot, field.type);
2915
              }
2916
              break;
2917
          }
2918
          iprot.readFieldEnd();
2919
        }
2920
      }
2921
      iprot.readStructEnd();
2922
      validate();
2923
    }
2924
 
2925
    public void write(TProtocol oprot) throws TException {
2926
      validate();
2927
 
2928
      oprot.writeStructBegin(STRUCT_DESC);
2929
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
2930
      oprot.writeI64(this.userId);
2931
      oprot.writeFieldEnd();
2932
      oprot.writeFieldBegin(FROM_TIME_FIELD_DESC);
695 rajveer 2933
      oprot.writeI64(this.fromTime);
123 ashish 2934
      oprot.writeFieldEnd();
2935
      oprot.writeFieldBegin(TO_TIME_FIELD_DESC);
695 rajveer 2936
      oprot.writeI64(this.toTime);
123 ashish 2937
      oprot.writeFieldEnd();
2938
      if (this.status != null) {
2939
        oprot.writeFieldBegin(STATUS_FIELD_DESC);
2940
        oprot.writeI32(this.status.getValue());
2941
        oprot.writeFieldEnd();
2942
      }
420 ashish 2943
      oprot.writeFieldBegin(GATEWAY_ID_FIELD_DESC);
695 rajveer 2944
      oprot.writeI64(this.gatewayId);
420 ashish 2945
      oprot.writeFieldEnd();
123 ashish 2946
      oprot.writeFieldStop();
2947
      oprot.writeStructEnd();
2948
    }
2949
 
2950
    @Override
2951
    public String toString() {
2952
      StringBuilder sb = new StringBuilder("getPaymentsForUser_args(");
2953
      boolean first = true;
2954
 
2955
      sb.append("userId:");
2956
      sb.append(this.userId);
2957
      first = false;
2958
      if (!first) sb.append(", ");
695 rajveer 2959
      sb.append("fromTime:");
2960
      sb.append(this.fromTime);
123 ashish 2961
      first = false;
2962
      if (!first) sb.append(", ");
695 rajveer 2963
      sb.append("toTime:");
2964
      sb.append(this.toTime);
123 ashish 2965
      first = false;
2966
      if (!first) sb.append(", ");
2967
      sb.append("status:");
2968
      if (this.status == null) {
2969
        sb.append("null");
2970
      } else {
2971
        String status_name = status.name();
2972
        if (status_name != null) {
2973
          sb.append(status_name);
2974
          sb.append(" (");
2975
        }
2976
        sb.append(this.status);
2977
        if (status_name != null) {
2978
          sb.append(")");
2979
        }
2980
      }
2981
      first = false;
2982
      if (!first) sb.append(", ");
695 rajveer 2983
      sb.append("gatewayId:");
2984
      sb.append(this.gatewayId);
123 ashish 2985
      first = false;
2986
      sb.append(")");
2987
      return sb.toString();
2988
    }
2989
 
2990
    public void validate() throws TException {
2991
      // check for required fields
2992
    }
2993
 
2994
  }
2995
 
695 rajveer 2996
  public static class getPaymentsForUser_result implements TBase<getPaymentsForUser_result._Fields>, java.io.Serializable, Cloneable, Comparable<getPaymentsForUser_result>   {
123 ashish 2997
    private static final TStruct STRUCT_DESC = new TStruct("getPaymentsForUser_result");
2998
 
2999
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0);
3000
    private static final TField PE_FIELD_DESC = new TField("pe", TType.STRUCT, (short)1);
3001
 
3002
    private List<Payment> success;
3003
    private PaymentException pe;
3004
 
3005
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3006
    public enum _Fields implements TFieldIdEnum {
3007
      SUCCESS((short)0, "success"),
3008
      PE((short)1, "pe");
3009
 
3010
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
3011
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3012
 
3013
      static {
3014
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3015
          byId.put((int)field._thriftId, field);
3016
          byName.put(field.getFieldName(), field);
3017
        }
3018
      }
3019
 
3020
      /**
3021
       * Find the _Fields constant that matches fieldId, or null if its not found.
3022
       */
3023
      public static _Fields findByThriftId(int fieldId) {
3024
        return byId.get(fieldId);
3025
      }
3026
 
3027
      /**
3028
       * Find the _Fields constant that matches fieldId, throwing an exception
3029
       * if it is not found.
3030
       */
3031
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3032
        _Fields fields = findByThriftId(fieldId);
3033
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3034
        return fields;
3035
      }
3036
 
3037
      /**
3038
       * Find the _Fields constant that matches name, or null if its not found.
3039
       */
3040
      public static _Fields findByName(String name) {
3041
        return byName.get(name);
3042
      }
3043
 
3044
      private final short _thriftId;
3045
      private final String _fieldName;
3046
 
3047
      _Fields(short thriftId, String fieldName) {
3048
        _thriftId = thriftId;
3049
        _fieldName = fieldName;
3050
      }
3051
 
3052
      public short getThriftFieldId() {
3053
        return _thriftId;
3054
      }
3055
 
3056
      public String getFieldName() {
3057
        return _fieldName;
3058
      }
3059
    }
3060
 
3061
    // isset id assignments
3062
 
3063
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
3064
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
3065
          new ListMetaData(TType.LIST, 
3066
              new StructMetaData(TType.STRUCT, Payment.class))));
3067
      put(_Fields.PE, new FieldMetaData("pe", TFieldRequirementType.DEFAULT, 
3068
          new FieldValueMetaData(TType.STRUCT)));
3069
    }});
3070
 
3071
    static {
3072
      FieldMetaData.addStructMetaDataMap(getPaymentsForUser_result.class, metaDataMap);
3073
    }
3074
 
3075
    public getPaymentsForUser_result() {
3076
    }
3077
 
3078
    public getPaymentsForUser_result(
3079
      List<Payment> success,
3080
      PaymentException pe)
3081
    {
3082
      this();
3083
      this.success = success;
3084
      this.pe = pe;
3085
    }
3086
 
3087
    /**
3088
     * Performs a deep copy on <i>other</i>.
3089
     */
3090
    public getPaymentsForUser_result(getPaymentsForUser_result other) {
3091
      if (other.isSetSuccess()) {
3092
        List<Payment> __this__success = new ArrayList<Payment>();
3093
        for (Payment other_element : other.success) {
3094
          __this__success.add(new Payment(other_element));
3095
        }
3096
        this.success = __this__success;
3097
      }
3098
      if (other.isSetPe()) {
3099
        this.pe = new PaymentException(other.pe);
3100
      }
3101
    }
3102
 
3103
    public getPaymentsForUser_result deepCopy() {
3104
      return new getPaymentsForUser_result(this);
3105
    }
3106
 
3107
    @Deprecated
3108
    public getPaymentsForUser_result clone() {
3109
      return new getPaymentsForUser_result(this);
3110
    }
3111
 
3112
    public int getSuccessSize() {
3113
      return (this.success == null) ? 0 : this.success.size();
3114
    }
3115
 
3116
    public java.util.Iterator<Payment> getSuccessIterator() {
3117
      return (this.success == null) ? null : this.success.iterator();
3118
    }
3119
 
3120
    public void addToSuccess(Payment elem) {
3121
      if (this.success == null) {
3122
        this.success = new ArrayList<Payment>();
3123
      }
3124
      this.success.add(elem);
3125
    }
3126
 
3127
    public List<Payment> getSuccess() {
3128
      return this.success;
3129
    }
3130
 
3131
    public getPaymentsForUser_result setSuccess(List<Payment> success) {
3132
      this.success = success;
3133
      return this;
3134
    }
3135
 
3136
    public void unsetSuccess() {
3137
      this.success = null;
3138
    }
3139
 
3140
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
3141
    public boolean isSetSuccess() {
3142
      return this.success != null;
3143
    }
3144
 
3145
    public void setSuccessIsSet(boolean value) {
3146
      if (!value) {
3147
        this.success = null;
3148
      }
3149
    }
3150
 
3151
    public PaymentException getPe() {
3152
      return this.pe;
3153
    }
3154
 
3155
    public getPaymentsForUser_result setPe(PaymentException pe) {
3156
      this.pe = pe;
3157
      return this;
3158
    }
3159
 
3160
    public void unsetPe() {
3161
      this.pe = null;
3162
    }
3163
 
3164
    /** Returns true if field pe is set (has been asigned a value) and false otherwise */
3165
    public boolean isSetPe() {
3166
      return this.pe != null;
3167
    }
3168
 
3169
    public void setPeIsSet(boolean value) {
3170
      if (!value) {
3171
        this.pe = null;
3172
      }
3173
    }
3174
 
3175
    public void setFieldValue(_Fields field, Object value) {
3176
      switch (field) {
3177
      case SUCCESS:
3178
        if (value == null) {
3179
          unsetSuccess();
3180
        } else {
3181
          setSuccess((List<Payment>)value);
3182
        }
3183
        break;
3184
 
3185
      case PE:
3186
        if (value == null) {
3187
          unsetPe();
3188
        } else {
3189
          setPe((PaymentException)value);
3190
        }
3191
        break;
3192
 
3193
      }
3194
    }
3195
 
3196
    public void setFieldValue(int fieldID, Object value) {
3197
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
3198
    }
3199
 
3200
    public Object getFieldValue(_Fields field) {
3201
      switch (field) {
3202
      case SUCCESS:
3203
        return getSuccess();
3204
 
3205
      case PE:
3206
        return getPe();
3207
 
3208
      }
3209
      throw new IllegalStateException();
3210
    }
3211
 
3212
    public Object getFieldValue(int fieldId) {
3213
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
3214
    }
3215
 
3216
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
3217
    public boolean isSet(_Fields field) {
3218
      switch (field) {
3219
      case SUCCESS:
3220
        return isSetSuccess();
3221
      case PE:
3222
        return isSetPe();
3223
      }
3224
      throw new IllegalStateException();
3225
    }
3226
 
3227
    public boolean isSet(int fieldID) {
3228
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
3229
    }
3230
 
3231
    @Override
3232
    public boolean equals(Object that) {
3233
      if (that == null)
3234
        return false;
3235
      if (that instanceof getPaymentsForUser_result)
3236
        return this.equals((getPaymentsForUser_result)that);
3237
      return false;
3238
    }
3239
 
3240
    public boolean equals(getPaymentsForUser_result that) {
3241
      if (that == null)
3242
        return false;
3243
 
3244
      boolean this_present_success = true && this.isSetSuccess();
3245
      boolean that_present_success = true && that.isSetSuccess();
3246
      if (this_present_success || that_present_success) {
3247
        if (!(this_present_success && that_present_success))
3248
          return false;
3249
        if (!this.success.equals(that.success))
3250
          return false;
3251
      }
3252
 
3253
      boolean this_present_pe = true && this.isSetPe();
3254
      boolean that_present_pe = true && that.isSetPe();
3255
      if (this_present_pe || that_present_pe) {
3256
        if (!(this_present_pe && that_present_pe))
3257
          return false;
3258
        if (!this.pe.equals(that.pe))
3259
          return false;
3260
      }
3261
 
3262
      return true;
3263
    }
3264
 
3265
    @Override
3266
    public int hashCode() {
3267
      return 0;
3268
    }
3269
 
695 rajveer 3270
    public int compareTo(getPaymentsForUser_result other) {
123 ashish 3271
      if (!getClass().equals(other.getClass())) {
3272
        return getClass().getName().compareTo(other.getClass().getName());
3273
      }
3274
 
3275
      int lastComparison = 0;
695 rajveer 3276
      getPaymentsForUser_result typedOther = (getPaymentsForUser_result)other;
123 ashish 3277
 
695 rajveer 3278
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
123 ashish 3279
      if (lastComparison != 0) {
3280
        return lastComparison;
3281
      }
695 rajveer 3282
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
123 ashish 3283
      if (lastComparison != 0) {
3284
        return lastComparison;
3285
      }
695 rajveer 3286
      lastComparison = Boolean.valueOf(isSetPe()).compareTo(isSetPe());
123 ashish 3287
      if (lastComparison != 0) {
3288
        return lastComparison;
3289
      }
695 rajveer 3290
      lastComparison = TBaseHelper.compareTo(pe, typedOther.pe);
123 ashish 3291
      if (lastComparison != 0) {
3292
        return lastComparison;
3293
      }
3294
      return 0;
3295
    }
3296
 
3297
    public void read(TProtocol iprot) throws TException {
3298
      TField field;
3299
      iprot.readStructBegin();
3300
      while (true)
3301
      {
3302
        field = iprot.readFieldBegin();
3303
        if (field.type == TType.STOP) { 
3304
          break;
3305
        }
3306
        _Fields fieldId = _Fields.findByThriftId(field.id);
3307
        if (fieldId == null) {
3308
          TProtocolUtil.skip(iprot, field.type);
3309
        } else {
3310
          switch (fieldId) {
3311
            case SUCCESS:
3312
              if (field.type == TType.LIST) {
3313
                {
695 rajveer 3314
                  TList _list8 = iprot.readListBegin();
3315
                  this.success = new ArrayList<Payment>(_list8.size);
3316
                  for (int _i9 = 0; _i9 < _list8.size; ++_i9)
123 ashish 3317
                  {
695 rajveer 3318
                    Payment _elem10;
3319
                    _elem10 = new Payment();
3320
                    _elem10.read(iprot);
3321
                    this.success.add(_elem10);
123 ashish 3322
                  }
3323
                  iprot.readListEnd();
3324
                }
3325
              } else { 
3326
                TProtocolUtil.skip(iprot, field.type);
3327
              }
3328
              break;
3329
            case PE:
3330
              if (field.type == TType.STRUCT) {
3331
                this.pe = new PaymentException();
3332
                this.pe.read(iprot);
3333
              } else { 
3334
                TProtocolUtil.skip(iprot, field.type);
3335
              }
3336
              break;
3337
          }
3338
          iprot.readFieldEnd();
3339
        }
3340
      }
3341
      iprot.readStructEnd();
3342
      validate();
3343
    }
3344
 
3345
    public void write(TProtocol oprot) throws TException {
3346
      oprot.writeStructBegin(STRUCT_DESC);
3347
 
3348
      if (this.isSetSuccess()) {
3349
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
3350
        {
3351
          oprot.writeListBegin(new TList(TType.STRUCT, this.success.size()));
695 rajveer 3352
          for (Payment _iter11 : this.success)
123 ashish 3353
          {
695 rajveer 3354
            _iter11.write(oprot);
123 ashish 3355
          }
3356
          oprot.writeListEnd();
3357
        }
3358
        oprot.writeFieldEnd();
3359
      } else if (this.isSetPe()) {
3360
        oprot.writeFieldBegin(PE_FIELD_DESC);
3361
        this.pe.write(oprot);
3362
        oprot.writeFieldEnd();
3363
      }
3364
      oprot.writeFieldStop();
3365
      oprot.writeStructEnd();
3366
    }
3367
 
3368
    @Override
3369
    public String toString() {
695 rajveer 3370
      StringBuilder sb = new StringBuilder("getPaymentsForUser_result(");
123 ashish 3371
      boolean first = true;
3372
 
3373
      sb.append("success:");
3374
      if (this.success == null) {
3375
        sb.append("null");
3376
      } else {
3377
        sb.append(this.success);
3378
      }
3379
      first = false;
3380
      if (!first) sb.append(", ");
3381
      sb.append("pe:");
3382
      if (this.pe == null) {
3383
        sb.append("null");
3384
      } else {
3385
        sb.append(this.pe);
3386
      }
3387
      first = false;
3388
      sb.append(")");
3389
      return sb.toString();
3390
    }
3391
 
3392
    public void validate() throws TException {
3393
      // check for required fields
3394
    }
3395
 
3396
  }
3397
 
3398
  public static class getPayments_args implements TBase<getPayments_args._Fields>, java.io.Serializable, Cloneable, Comparable<getPayments_args>   {
3399
    private static final TStruct STRUCT_DESC = new TStruct("getPayments_args");
3400
 
695 rajveer 3401
    private static final TField FROM_TIME_FIELD_DESC = new TField("fromTime", TType.I64, (short)1);
3402
    private static final TField TO_TIME_FIELD_DESC = new TField("toTime", TType.I64, (short)2);
123 ashish 3403
    private static final TField STATUS_FIELD_DESC = new TField("status", TType.I32, (short)3);
695 rajveer 3404
    private static final TField GATEWAY_ID_FIELD_DESC = new TField("gatewayId", TType.I64, (short)4);
123 ashish 3405
 
695 rajveer 3406
    private long fromTime;
3407
    private long toTime;
123 ashish 3408
    private PaymentStatus status;
695 rajveer 3409
    private long gatewayId;
123 ashish 3410
 
3411
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3412
    public enum _Fields implements TFieldIdEnum {
695 rajveer 3413
      FROM_TIME((short)1, "fromTime"),
3414
      TO_TIME((short)2, "toTime"),
123 ashish 3415
      /**
3416
       * 
3417
       * @see PaymentStatus
3418
       */
3419
      STATUS((short)3, "status"),
695 rajveer 3420
      GATEWAY_ID((short)4, "gatewayId");
123 ashish 3421
 
3422
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
3423
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3424
 
3425
      static {
3426
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3427
          byId.put((int)field._thriftId, field);
3428
          byName.put(field.getFieldName(), field);
3429
        }
3430
      }
3431
 
3432
      /**
3433
       * Find the _Fields constant that matches fieldId, or null if its not found.
3434
       */
3435
      public static _Fields findByThriftId(int fieldId) {
3436
        return byId.get(fieldId);
3437
      }
3438
 
3439
      /**
3440
       * Find the _Fields constant that matches fieldId, throwing an exception
3441
       * if it is not found.
3442
       */
3443
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3444
        _Fields fields = findByThriftId(fieldId);
3445
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3446
        return fields;
3447
      }
3448
 
3449
      /**
3450
       * Find the _Fields constant that matches name, or null if its not found.
3451
       */
3452
      public static _Fields findByName(String name) {
3453
        return byName.get(name);
3454
      }
3455
 
3456
      private final short _thriftId;
3457
      private final String _fieldName;
3458
 
3459
      _Fields(short thriftId, String fieldName) {
3460
        _thriftId = thriftId;
3461
        _fieldName = fieldName;
3462
      }
3463
 
3464
      public short getThriftFieldId() {
3465
        return _thriftId;
3466
      }
3467
 
3468
      public String getFieldName() {
3469
        return _fieldName;
3470
      }
3471
    }
3472
 
3473
    // isset id assignments
695 rajveer 3474
    private static final int __FROMTIME_ISSET_ID = 0;
3475
    private static final int __TOTIME_ISSET_ID = 1;
3476
    private static final int __GATEWAYID_ISSET_ID = 2;
420 ashish 3477
    private BitSet __isset_bit_vector = new BitSet(3);
123 ashish 3478
 
3479
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
695 rajveer 3480
      put(_Fields.FROM_TIME, new FieldMetaData("fromTime", TFieldRequirementType.DEFAULT, 
123 ashish 3481
          new FieldValueMetaData(TType.I64)));
695 rajveer 3482
      put(_Fields.TO_TIME, new FieldMetaData("toTime", TFieldRequirementType.DEFAULT, 
123 ashish 3483
          new FieldValueMetaData(TType.I64)));
3484
      put(_Fields.STATUS, new FieldMetaData("status", TFieldRequirementType.DEFAULT, 
3485
          new EnumMetaData(TType.ENUM, PaymentStatus.class)));
695 rajveer 3486
      put(_Fields.GATEWAY_ID, new FieldMetaData("gatewayId", TFieldRequirementType.DEFAULT, 
420 ashish 3487
          new FieldValueMetaData(TType.I64)));
123 ashish 3488
    }});
3489
 
3490
    static {
3491
      FieldMetaData.addStructMetaDataMap(getPayments_args.class, metaDataMap);
3492
    }
3493
 
3494
    public getPayments_args() {
3495
    }
3496
 
3497
    public getPayments_args(
695 rajveer 3498
      long fromTime,
3499
      long toTime,
123 ashish 3500
      PaymentStatus status,
695 rajveer 3501
      long gatewayId)
123 ashish 3502
    {
3503
      this();
695 rajveer 3504
      this.fromTime = fromTime;
3505
      setFromTimeIsSet(true);
3506
      this.toTime = toTime;
3507
      setToTimeIsSet(true);
123 ashish 3508
      this.status = status;
695 rajveer 3509
      this.gatewayId = gatewayId;
3510
      setGatewayIdIsSet(true);
123 ashish 3511
    }
3512
 
3513
    /**
3514
     * Performs a deep copy on <i>other</i>.
3515
     */
3516
    public getPayments_args(getPayments_args other) {
3517
      __isset_bit_vector.clear();
3518
      __isset_bit_vector.or(other.__isset_bit_vector);
695 rajveer 3519
      this.fromTime = other.fromTime;
3520
      this.toTime = other.toTime;
123 ashish 3521
      if (other.isSetStatus()) {
3522
        this.status = other.status;
3523
      }
695 rajveer 3524
      this.gatewayId = other.gatewayId;
123 ashish 3525
    }
3526
 
3527
    public getPayments_args deepCopy() {
3528
      return new getPayments_args(this);
3529
    }
3530
 
3531
    @Deprecated
3532
    public getPayments_args clone() {
3533
      return new getPayments_args(this);
3534
    }
3535
 
695 rajveer 3536
    public long getFromTime() {
3537
      return this.fromTime;
123 ashish 3538
    }
3539
 
695 rajveer 3540
    public getPayments_args setFromTime(long fromTime) {
3541
      this.fromTime = fromTime;
3542
      setFromTimeIsSet(true);
123 ashish 3543
      return this;
3544
    }
3545
 
695 rajveer 3546
    public void unsetFromTime() {
3547
      __isset_bit_vector.clear(__FROMTIME_ISSET_ID);
123 ashish 3548
    }
3549
 
695 rajveer 3550
    /** Returns true if field fromTime is set (has been asigned a value) and false otherwise */
3551
    public boolean isSetFromTime() {
3552
      return __isset_bit_vector.get(__FROMTIME_ISSET_ID);
123 ashish 3553
    }
3554
 
695 rajveer 3555
    public void setFromTimeIsSet(boolean value) {
3556
      __isset_bit_vector.set(__FROMTIME_ISSET_ID, value);
123 ashish 3557
    }
3558
 
695 rajveer 3559
    public long getToTime() {
3560
      return this.toTime;
123 ashish 3561
    }
3562
 
695 rajveer 3563
    public getPayments_args setToTime(long toTime) {
3564
      this.toTime = toTime;
3565
      setToTimeIsSet(true);
123 ashish 3566
      return this;
3567
    }
3568
 
695 rajveer 3569
    public void unsetToTime() {
3570
      __isset_bit_vector.clear(__TOTIME_ISSET_ID);
123 ashish 3571
    }
3572
 
695 rajveer 3573
    /** Returns true if field toTime is set (has been asigned a value) and false otherwise */
3574
    public boolean isSetToTime() {
3575
      return __isset_bit_vector.get(__TOTIME_ISSET_ID);
123 ashish 3576
    }
3577
 
695 rajveer 3578
    public void setToTimeIsSet(boolean value) {
3579
      __isset_bit_vector.set(__TOTIME_ISSET_ID, value);
123 ashish 3580
    }
3581
 
3582
    /**
3583
     * 
3584
     * @see PaymentStatus
3585
     */
3586
    public PaymentStatus getStatus() {
3587
      return this.status;
3588
    }
3589
 
3590
    /**
3591
     * 
3592
     * @see PaymentStatus
3593
     */
3594
    public getPayments_args setStatus(PaymentStatus status) {
3595
      this.status = status;
3596
      return this;
3597
    }
3598
 
3599
    public void unsetStatus() {
3600
      this.status = null;
3601
    }
3602
 
3603
    /** Returns true if field status is set (has been asigned a value) and false otherwise */
3604
    public boolean isSetStatus() {
3605
      return this.status != null;
3606
    }
3607
 
3608
    public void setStatusIsSet(boolean value) {
3609
      if (!value) {
3610
        this.status = null;
3611
      }
3612
    }
3613
 
695 rajveer 3614
    public long getGatewayId() {
3615
      return this.gatewayId;
123 ashish 3616
    }
3617
 
695 rajveer 3618
    public getPayments_args setGatewayId(long gatewayId) {
3619
      this.gatewayId = gatewayId;
3620
      setGatewayIdIsSet(true);
123 ashish 3621
      return this;
3622
    }
3623
 
695 rajveer 3624
    public void unsetGatewayId() {
3625
      __isset_bit_vector.clear(__GATEWAYID_ISSET_ID);
123 ashish 3626
    }
3627
 
695 rajveer 3628
    /** Returns true if field gatewayId is set (has been asigned a value) and false otherwise */
3629
    public boolean isSetGatewayId() {
3630
      return __isset_bit_vector.get(__GATEWAYID_ISSET_ID);
123 ashish 3631
    }
3632
 
695 rajveer 3633
    public void setGatewayIdIsSet(boolean value) {
3634
      __isset_bit_vector.set(__GATEWAYID_ISSET_ID, value);
123 ashish 3635
    }
3636
 
3637
    public void setFieldValue(_Fields field, Object value) {
3638
      switch (field) {
3639
      case FROM_TIME:
3640
        if (value == null) {
695 rajveer 3641
          unsetFromTime();
123 ashish 3642
        } else {
695 rajveer 3643
          setFromTime((Long)value);
123 ashish 3644
        }
3645
        break;
3646
 
3647
      case TO_TIME:
3648
        if (value == null) {
695 rajveer 3649
          unsetToTime();
123 ashish 3650
        } else {
695 rajveer 3651
          setToTime((Long)value);
123 ashish 3652
        }
3653
        break;
3654
 
3655
      case STATUS:
3656
        if (value == null) {
3657
          unsetStatus();
3658
        } else {
3659
          setStatus((PaymentStatus)value);
3660
        }
3661
        break;
3662
 
420 ashish 3663
      case GATEWAY_ID:
123 ashish 3664
        if (value == null) {
695 rajveer 3665
          unsetGatewayId();
123 ashish 3666
        } else {
695 rajveer 3667
          setGatewayId((Long)value);
123 ashish 3668
        }
3669
        break;
3670
 
3671
      }
3672
    }
3673
 
3674
    public void setFieldValue(int fieldID, Object value) {
3675
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
3676
    }
3677
 
3678
    public Object getFieldValue(_Fields field) {
3679
      switch (field) {
3680
      case FROM_TIME:
695 rajveer 3681
        return new Long(getFromTime());
123 ashish 3682
 
3683
      case TO_TIME:
695 rajveer 3684
        return new Long(getToTime());
123 ashish 3685
 
3686
      case STATUS:
3687
        return getStatus();
3688
 
420 ashish 3689
      case GATEWAY_ID:
695 rajveer 3690
        return new Long(getGatewayId());
123 ashish 3691
 
3692
      }
3693
      throw new IllegalStateException();
3694
    }
3695
 
3696
    public Object getFieldValue(int fieldId) {
3697
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
3698
    }
3699
 
3700
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
3701
    public boolean isSet(_Fields field) {
3702
      switch (field) {
3703
      case FROM_TIME:
695 rajveer 3704
        return isSetFromTime();
123 ashish 3705
      case TO_TIME:
695 rajveer 3706
        return isSetToTime();
123 ashish 3707
      case STATUS:
3708
        return isSetStatus();
420 ashish 3709
      case GATEWAY_ID:
695 rajveer 3710
        return isSetGatewayId();
123 ashish 3711
      }
3712
      throw new IllegalStateException();
3713
    }
3714
 
3715
    public boolean isSet(int fieldID) {
3716
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
3717
    }
3718
 
3719
    @Override
3720
    public boolean equals(Object that) {
3721
      if (that == null)
3722
        return false;
3723
      if (that instanceof getPayments_args)
3724
        return this.equals((getPayments_args)that);
3725
      return false;
3726
    }
3727
 
3728
    public boolean equals(getPayments_args that) {
3729
      if (that == null)
3730
        return false;
3731
 
695 rajveer 3732
      boolean this_present_fromTime = true;
3733
      boolean that_present_fromTime = true;
3734
      if (this_present_fromTime || that_present_fromTime) {
3735
        if (!(this_present_fromTime && that_present_fromTime))
123 ashish 3736
          return false;
695 rajveer 3737
        if (this.fromTime != that.fromTime)
123 ashish 3738
          return false;
3739
      }
3740
 
695 rajveer 3741
      boolean this_present_toTime = true;
3742
      boolean that_present_toTime = true;
3743
      if (this_present_toTime || that_present_toTime) {
3744
        if (!(this_present_toTime && that_present_toTime))
123 ashish 3745
          return false;
695 rajveer 3746
        if (this.toTime != that.toTime)
123 ashish 3747
          return false;
3748
      }
3749
 
3750
      boolean this_present_status = true && this.isSetStatus();
3751
      boolean that_present_status = true && that.isSetStatus();
3752
      if (this_present_status || that_present_status) {
3753
        if (!(this_present_status && that_present_status))
3754
          return false;
3755
        if (!this.status.equals(that.status))
3756
          return false;
3757
      }
3758
 
695 rajveer 3759
      boolean this_present_gatewayId = true;
3760
      boolean that_present_gatewayId = true;
3761
      if (this_present_gatewayId || that_present_gatewayId) {
3762
        if (!(this_present_gatewayId && that_present_gatewayId))
123 ashish 3763
          return false;
695 rajveer 3764
        if (this.gatewayId != that.gatewayId)
123 ashish 3765
          return false;
3766
      }
3767
 
3768
      return true;
3769
    }
3770
 
3771
    @Override
3772
    public int hashCode() {
3773
      return 0;
3774
    }
3775
 
3776
    public int compareTo(getPayments_args other) {
3777
      if (!getClass().equals(other.getClass())) {
3778
        return getClass().getName().compareTo(other.getClass().getName());
3779
      }
3780
 
3781
      int lastComparison = 0;
3782
      getPayments_args typedOther = (getPayments_args)other;
3783
 
695 rajveer 3784
      lastComparison = Boolean.valueOf(isSetFromTime()).compareTo(isSetFromTime());
123 ashish 3785
      if (lastComparison != 0) {
3786
        return lastComparison;
3787
      }
695 rajveer 3788
      lastComparison = TBaseHelper.compareTo(fromTime, typedOther.fromTime);
123 ashish 3789
      if (lastComparison != 0) {
3790
        return lastComparison;
3791
      }
695 rajveer 3792
      lastComparison = Boolean.valueOf(isSetToTime()).compareTo(isSetToTime());
123 ashish 3793
      if (lastComparison != 0) {
3794
        return lastComparison;
3795
      }
695 rajveer 3796
      lastComparison = TBaseHelper.compareTo(toTime, typedOther.toTime);
123 ashish 3797
      if (lastComparison != 0) {
3798
        return lastComparison;
3799
      }
3800
      lastComparison = Boolean.valueOf(isSetStatus()).compareTo(isSetStatus());
3801
      if (lastComparison != 0) {
3802
        return lastComparison;
3803
      }
3804
      lastComparison = TBaseHelper.compareTo(status, typedOther.status);
3805
      if (lastComparison != 0) {
3806
        return lastComparison;
3807
      }
695 rajveer 3808
      lastComparison = Boolean.valueOf(isSetGatewayId()).compareTo(isSetGatewayId());
123 ashish 3809
      if (lastComparison != 0) {
3810
        return lastComparison;
3811
      }
695 rajveer 3812
      lastComparison = TBaseHelper.compareTo(gatewayId, typedOther.gatewayId);
123 ashish 3813
      if (lastComparison != 0) {
3814
        return lastComparison;
3815
      }
3816
      return 0;
3817
    }
3818
 
3819
    public void read(TProtocol iprot) throws TException {
3820
      TField field;
3821
      iprot.readStructBegin();
3822
      while (true)
3823
      {
3824
        field = iprot.readFieldBegin();
3825
        if (field.type == TType.STOP) { 
3826
          break;
3827
        }
3828
        _Fields fieldId = _Fields.findByThriftId(field.id);
3829
        if (fieldId == null) {
3830
          TProtocolUtil.skip(iprot, field.type);
3831
        } else {
3832
          switch (fieldId) {
3833
            case FROM_TIME:
3834
              if (field.type == TType.I64) {
695 rajveer 3835
                this.fromTime = iprot.readI64();
3836
                setFromTimeIsSet(true);
123 ashish 3837
              } else { 
3838
                TProtocolUtil.skip(iprot, field.type);
3839
              }
3840
              break;
3841
            case TO_TIME:
3842
              if (field.type == TType.I64) {
695 rajveer 3843
                this.toTime = iprot.readI64();
3844
                setToTimeIsSet(true);
123 ashish 3845
              } else { 
3846
                TProtocolUtil.skip(iprot, field.type);
3847
              }
3848
              break;
3849
            case STATUS:
3850
              if (field.type == TType.I32) {
3851
                this.status = PaymentStatus.findByValue(iprot.readI32());
3852
              } else { 
3853
                TProtocolUtil.skip(iprot, field.type);
3854
              }
3855
              break;
420 ashish 3856
            case GATEWAY_ID:
3857
              if (field.type == TType.I64) {
695 rajveer 3858
                this.gatewayId = iprot.readI64();
3859
                setGatewayIdIsSet(true);
123 ashish 3860
              } else { 
3861
                TProtocolUtil.skip(iprot, field.type);
3862
              }
3863
              break;
3864
          }
3865
          iprot.readFieldEnd();
3866
        }
3867
      }
3868
      iprot.readStructEnd();
3869
      validate();
3870
    }
3871
 
3872
    public void write(TProtocol oprot) throws TException {
3873
      validate();
3874
 
3875
      oprot.writeStructBegin(STRUCT_DESC);
3876
      oprot.writeFieldBegin(FROM_TIME_FIELD_DESC);
695 rajveer 3877
      oprot.writeI64(this.fromTime);
123 ashish 3878
      oprot.writeFieldEnd();
3879
      oprot.writeFieldBegin(TO_TIME_FIELD_DESC);
695 rajveer 3880
      oprot.writeI64(this.toTime);
123 ashish 3881
      oprot.writeFieldEnd();
3882
      if (this.status != null) {
3883
        oprot.writeFieldBegin(STATUS_FIELD_DESC);
3884
        oprot.writeI32(this.status.getValue());
3885
        oprot.writeFieldEnd();
3886
      }
420 ashish 3887
      oprot.writeFieldBegin(GATEWAY_ID_FIELD_DESC);
695 rajveer 3888
      oprot.writeI64(this.gatewayId);
420 ashish 3889
      oprot.writeFieldEnd();
123 ashish 3890
      oprot.writeFieldStop();
3891
      oprot.writeStructEnd();
3892
    }
3893
 
3894
    @Override
3895
    public String toString() {
3896
      StringBuilder sb = new StringBuilder("getPayments_args(");
3897
      boolean first = true;
3898
 
695 rajveer 3899
      sb.append("fromTime:");
3900
      sb.append(this.fromTime);
123 ashish 3901
      first = false;
3902
      if (!first) sb.append(", ");
695 rajveer 3903
      sb.append("toTime:");
3904
      sb.append(this.toTime);
123 ashish 3905
      first = false;
3906
      if (!first) sb.append(", ");
3907
      sb.append("status:");
3908
      if (this.status == null) {
3909
        sb.append("null");
3910
      } else {
3911
        String status_name = status.name();
3912
        if (status_name != null) {
3913
          sb.append(status_name);
3914
          sb.append(" (");
3915
        }
3916
        sb.append(this.status);
3917
        if (status_name != null) {
3918
          sb.append(")");
3919
        }
3920
      }
3921
      first = false;
3922
      if (!first) sb.append(", ");
695 rajveer 3923
      sb.append("gatewayId:");
3924
      sb.append(this.gatewayId);
123 ashish 3925
      first = false;
3926
      sb.append(")");
3927
      return sb.toString();
3928
    }
3929
 
3930
    public void validate() throws TException {
3931
      // check for required fields
3932
    }
3933
 
3934
  }
3935
 
695 rajveer 3936
  public static class getPayments_result implements TBase<getPayments_result._Fields>, java.io.Serializable, Cloneable, Comparable<getPayments_result>   {
123 ashish 3937
    private static final TStruct STRUCT_DESC = new TStruct("getPayments_result");
3938
 
3939
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0);
3940
    private static final TField PE_FIELD_DESC = new TField("pe", TType.STRUCT, (short)1);
3941
 
3942
    private List<Payment> success;
3943
    private PaymentException pe;
3944
 
3945
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3946
    public enum _Fields implements TFieldIdEnum {
3947
      SUCCESS((short)0, "success"),
3948
      PE((short)1, "pe");
3949
 
3950
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
3951
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3952
 
3953
      static {
3954
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3955
          byId.put((int)field._thriftId, field);
3956
          byName.put(field.getFieldName(), field);
3957
        }
3958
      }
3959
 
3960
      /**
3961
       * Find the _Fields constant that matches fieldId, or null if its not found.
3962
       */
3963
      public static _Fields findByThriftId(int fieldId) {
3964
        return byId.get(fieldId);
3965
      }
3966
 
3967
      /**
3968
       * Find the _Fields constant that matches fieldId, throwing an exception
3969
       * if it is not found.
3970
       */
3971
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3972
        _Fields fields = findByThriftId(fieldId);
3973
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3974
        return fields;
3975
      }
3976
 
3977
      /**
3978
       * Find the _Fields constant that matches name, or null if its not found.
3979
       */
3980
      public static _Fields findByName(String name) {
3981
        return byName.get(name);
3982
      }
3983
 
3984
      private final short _thriftId;
3985
      private final String _fieldName;
3986
 
3987
      _Fields(short thriftId, String fieldName) {
3988
        _thriftId = thriftId;
3989
        _fieldName = fieldName;
3990
      }
3991
 
3992
      public short getThriftFieldId() {
3993
        return _thriftId;
3994
      }
3995
 
3996
      public String getFieldName() {
3997
        return _fieldName;
3998
      }
3999
    }
4000
 
4001
    // isset id assignments
4002
 
4003
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
4004
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
4005
          new ListMetaData(TType.LIST, 
4006
              new StructMetaData(TType.STRUCT, Payment.class))));
4007
      put(_Fields.PE, new FieldMetaData("pe", TFieldRequirementType.DEFAULT, 
4008
          new FieldValueMetaData(TType.STRUCT)));
4009
    }});
4010
 
4011
    static {
4012
      FieldMetaData.addStructMetaDataMap(getPayments_result.class, metaDataMap);
4013
    }
4014
 
4015
    public getPayments_result() {
4016
    }
4017
 
4018
    public getPayments_result(
4019
      List<Payment> success,
4020
      PaymentException pe)
4021
    {
4022
      this();
4023
      this.success = success;
4024
      this.pe = pe;
4025
    }
4026
 
4027
    /**
4028
     * Performs a deep copy on <i>other</i>.
4029
     */
4030
    public getPayments_result(getPayments_result other) {
4031
      if (other.isSetSuccess()) {
4032
        List<Payment> __this__success = new ArrayList<Payment>();
4033
        for (Payment other_element : other.success) {
4034
          __this__success.add(new Payment(other_element));
4035
        }
4036
        this.success = __this__success;
4037
      }
4038
      if (other.isSetPe()) {
4039
        this.pe = new PaymentException(other.pe);
4040
      }
4041
    }
4042
 
4043
    public getPayments_result deepCopy() {
4044
      return new getPayments_result(this);
4045
    }
4046
 
4047
    @Deprecated
4048
    public getPayments_result clone() {
4049
      return new getPayments_result(this);
4050
    }
4051
 
4052
    public int getSuccessSize() {
4053
      return (this.success == null) ? 0 : this.success.size();
4054
    }
4055
 
4056
    public java.util.Iterator<Payment> getSuccessIterator() {
4057
      return (this.success == null) ? null : this.success.iterator();
4058
    }
4059
 
4060
    public void addToSuccess(Payment elem) {
4061
      if (this.success == null) {
4062
        this.success = new ArrayList<Payment>();
4063
      }
4064
      this.success.add(elem);
4065
    }
4066
 
4067
    public List<Payment> getSuccess() {
4068
      return this.success;
4069
    }
4070
 
4071
    public getPayments_result setSuccess(List<Payment> success) {
4072
      this.success = success;
4073
      return this;
4074
    }
4075
 
4076
    public void unsetSuccess() {
4077
      this.success = null;
4078
    }
4079
 
4080
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
4081
    public boolean isSetSuccess() {
4082
      return this.success != null;
4083
    }
4084
 
4085
    public void setSuccessIsSet(boolean value) {
4086
      if (!value) {
4087
        this.success = null;
4088
      }
4089
    }
4090
 
4091
    public PaymentException getPe() {
4092
      return this.pe;
4093
    }
4094
 
4095
    public getPayments_result setPe(PaymentException pe) {
4096
      this.pe = pe;
4097
      return this;
4098
    }
4099
 
4100
    public void unsetPe() {
4101
      this.pe = null;
4102
    }
4103
 
4104
    /** Returns true if field pe is set (has been asigned a value) and false otherwise */
4105
    public boolean isSetPe() {
4106
      return this.pe != null;
4107
    }
4108
 
4109
    public void setPeIsSet(boolean value) {
4110
      if (!value) {
4111
        this.pe = null;
4112
      }
4113
    }
4114
 
4115
    public void setFieldValue(_Fields field, Object value) {
4116
      switch (field) {
4117
      case SUCCESS:
4118
        if (value == null) {
4119
          unsetSuccess();
4120
        } else {
4121
          setSuccess((List<Payment>)value);
4122
        }
4123
        break;
4124
 
4125
      case PE:
4126
        if (value == null) {
4127
          unsetPe();
4128
        } else {
4129
          setPe((PaymentException)value);
4130
        }
4131
        break;
4132
 
4133
      }
4134
    }
4135
 
4136
    public void setFieldValue(int fieldID, Object value) {
4137
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
4138
    }
4139
 
4140
    public Object getFieldValue(_Fields field) {
4141
      switch (field) {
4142
      case SUCCESS:
4143
        return getSuccess();
4144
 
4145
      case PE:
4146
        return getPe();
4147
 
4148
      }
4149
      throw new IllegalStateException();
4150
    }
4151
 
4152
    public Object getFieldValue(int fieldId) {
4153
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
4154
    }
4155
 
4156
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
4157
    public boolean isSet(_Fields field) {
4158
      switch (field) {
4159
      case SUCCESS:
4160
        return isSetSuccess();
4161
      case PE:
4162
        return isSetPe();
4163
      }
4164
      throw new IllegalStateException();
4165
    }
4166
 
4167
    public boolean isSet(int fieldID) {
4168
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
4169
    }
4170
 
4171
    @Override
4172
    public boolean equals(Object that) {
4173
      if (that == null)
4174
        return false;
4175
      if (that instanceof getPayments_result)
4176
        return this.equals((getPayments_result)that);
4177
      return false;
4178
    }
4179
 
4180
    public boolean equals(getPayments_result that) {
4181
      if (that == null)
4182
        return false;
4183
 
4184
      boolean this_present_success = true && this.isSetSuccess();
4185
      boolean that_present_success = true && that.isSetSuccess();
4186
      if (this_present_success || that_present_success) {
4187
        if (!(this_present_success && that_present_success))
4188
          return false;
4189
        if (!this.success.equals(that.success))
4190
          return false;
4191
      }
4192
 
4193
      boolean this_present_pe = true && this.isSetPe();
4194
      boolean that_present_pe = true && that.isSetPe();
4195
      if (this_present_pe || that_present_pe) {
4196
        if (!(this_present_pe && that_present_pe))
4197
          return false;
4198
        if (!this.pe.equals(that.pe))
4199
          return false;
4200
      }
4201
 
4202
      return true;
4203
    }
4204
 
4205
    @Override
4206
    public int hashCode() {
4207
      return 0;
4208
    }
4209
 
695 rajveer 4210
    public int compareTo(getPayments_result other) {
123 ashish 4211
      if (!getClass().equals(other.getClass())) {
4212
        return getClass().getName().compareTo(other.getClass().getName());
4213
      }
4214
 
4215
      int lastComparison = 0;
695 rajveer 4216
      getPayments_result typedOther = (getPayments_result)other;
123 ashish 4217
 
695 rajveer 4218
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
123 ashish 4219
      if (lastComparison != 0) {
4220
        return lastComparison;
4221
      }
695 rajveer 4222
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
123 ashish 4223
      if (lastComparison != 0) {
4224
        return lastComparison;
4225
      }
695 rajveer 4226
      lastComparison = Boolean.valueOf(isSetPe()).compareTo(isSetPe());
4227
      if (lastComparison != 0) {
4228
        return lastComparison;
123 ashish 4229
      }
695 rajveer 4230
      lastComparison = TBaseHelper.compareTo(pe, typedOther.pe);
4231
      if (lastComparison != 0) {
4232
        return lastComparison;
123 ashish 4233
      }
4234
      return 0;
4235
    }
4236
 
4237
    public void read(TProtocol iprot) throws TException {
4238
      TField field;
4239
      iprot.readStructBegin();
4240
      while (true)
4241
      {
4242
        field = iprot.readFieldBegin();
4243
        if (field.type == TType.STOP) { 
4244
          break;
4245
        }
4246
        _Fields fieldId = _Fields.findByThriftId(field.id);
4247
        if (fieldId == null) {
4248
          TProtocolUtil.skip(iprot, field.type);
4249
        } else {
4250
          switch (fieldId) {
4251
            case SUCCESS:
420 ashish 4252
              if (field.type == TType.LIST) {
4253
                {
695 rajveer 4254
                  TList _list12 = iprot.readListBegin();
4255
                  this.success = new ArrayList<Payment>(_list12.size);
4256
                  for (int _i13 = 0; _i13 < _list12.size; ++_i13)
420 ashish 4257
                  {
695 rajveer 4258
                    Payment _elem14;
4259
                    _elem14 = new Payment();
4260
                    _elem14.read(iprot);
4261
                    this.success.add(_elem14);
420 ashish 4262
                  }
4263
                  iprot.readListEnd();
4264
                }
123 ashish 4265
              } else { 
4266
                TProtocolUtil.skip(iprot, field.type);
4267
              }
4268
              break;
4269
            case PE:
4270
              if (field.type == TType.STRUCT) {
4271
                this.pe = new PaymentException();
4272
                this.pe.read(iprot);
4273
              } else { 
4274
                TProtocolUtil.skip(iprot, field.type);
4275
              }
4276
              break;
4277
          }
4278
          iprot.readFieldEnd();
4279
        }
4280
      }
4281
      iprot.readStructEnd();
4282
      validate();
4283
    }
4284
 
4285
    public void write(TProtocol oprot) throws TException {
4286
      oprot.writeStructBegin(STRUCT_DESC);
4287
 
4288
      if (this.isSetSuccess()) {
4289
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
420 ashish 4290
        {
4291
          oprot.writeListBegin(new TList(TType.STRUCT, this.success.size()));
695 rajveer 4292
          for (Payment _iter15 : this.success)
420 ashish 4293
          {
695 rajveer 4294
            _iter15.write(oprot);
420 ashish 4295
          }
4296
          oprot.writeListEnd();
4297
        }
123 ashish 4298
        oprot.writeFieldEnd();
4299
      } else if (this.isSetPe()) {
4300
        oprot.writeFieldBegin(PE_FIELD_DESC);
4301
        this.pe.write(oprot);
4302
        oprot.writeFieldEnd();
4303
      }
4304
      oprot.writeFieldStop();
4305
      oprot.writeStructEnd();
4306
    }
4307
 
4308
    @Override
4309
    public String toString() {
695 rajveer 4310
      StringBuilder sb = new StringBuilder("getPayments_result(");
123 ashish 4311
      boolean first = true;
4312
 
4313
      sb.append("success:");
4314
      if (this.success == null) {
4315
        sb.append("null");
4316
      } else {
4317
        sb.append(this.success);
4318
      }
4319
      first = false;
4320
      if (!first) sb.append(", ");
4321
      sb.append("pe:");
4322
      if (this.pe == null) {
4323
        sb.append("null");
4324
      } else {
4325
        sb.append(this.pe);
4326
      }
4327
      first = false;
4328
      sb.append(")");
4329
      return sb.toString();
4330
    }
4331
 
4332
    public void validate() throws TException {
4333
      // check for required fields
4334
    }
4335
 
4336
  }
4337
 
695 rajveer 4338
  public static class getPaymentGateway_args implements TBase<getPaymentGateway_args._Fields>, java.io.Serializable, Cloneable, Comparable<getPaymentGateway_args>   {
4339
    private static final TStruct STRUCT_DESC = new TStruct("getPaymentGateway_args");
123 ashish 4340
 
420 ashish 4341
    private static final TField ID_FIELD_DESC = new TField("id", TType.I64, (short)1);
123 ashish 4342
 
420 ashish 4343
    private long id;
123 ashish 4344
 
4345
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
4346
    public enum _Fields implements TFieldIdEnum {
695 rajveer 4347
      ID((short)1, "id");
123 ashish 4348
 
4349
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
4350
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4351
 
4352
      static {
4353
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4354
          byId.put((int)field._thriftId, field);
4355
          byName.put(field.getFieldName(), field);
4356
        }
4357
      }
4358
 
4359
      /**
4360
       * Find the _Fields constant that matches fieldId, or null if its not found.
4361
       */
4362
      public static _Fields findByThriftId(int fieldId) {
4363
        return byId.get(fieldId);
4364
      }
4365
 
4366
      /**
4367
       * Find the _Fields constant that matches fieldId, throwing an exception
4368
       * if it is not found.
4369
       */
4370
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4371
        _Fields fields = findByThriftId(fieldId);
4372
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4373
        return fields;
4374
      }
4375
 
4376
      /**
4377
       * Find the _Fields constant that matches name, or null if its not found.
4378
       */
4379
      public static _Fields findByName(String name) {
4380
        return byName.get(name);
4381
      }
4382
 
4383
      private final short _thriftId;
4384
      private final String _fieldName;
4385
 
4386
      _Fields(short thriftId, String fieldName) {
4387
        _thriftId = thriftId;
4388
        _fieldName = fieldName;
4389
      }
4390
 
4391
      public short getThriftFieldId() {
4392
        return _thriftId;
4393
      }
4394
 
4395
      public String getFieldName() {
4396
        return _fieldName;
4397
      }
4398
    }
4399
 
4400
    // isset id assignments
420 ashish 4401
    private static final int __ID_ISSET_ID = 0;
123 ashish 4402
    private BitSet __isset_bit_vector = new BitSet(1);
4403
 
4404
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
420 ashish 4405
      put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, 
123 ashish 4406
          new FieldValueMetaData(TType.I64)));
4407
    }});
4408
 
4409
    static {
695 rajveer 4410
      FieldMetaData.addStructMetaDataMap(getPaymentGateway_args.class, metaDataMap);
123 ashish 4411
    }
4412
 
695 rajveer 4413
    public getPaymentGateway_args() {
123 ashish 4414
    }
4415
 
695 rajveer 4416
    public getPaymentGateway_args(
4417
      long id)
123 ashish 4418
    {
4419
      this();
420 ashish 4420
      this.id = id;
4421
      setIdIsSet(true);
123 ashish 4422
    }
4423
 
4424
    /**
4425
     * Performs a deep copy on <i>other</i>.
4426
     */
695 rajveer 4427
    public getPaymentGateway_args(getPaymentGateway_args other) {
123 ashish 4428
      __isset_bit_vector.clear();
4429
      __isset_bit_vector.or(other.__isset_bit_vector);
420 ashish 4430
      this.id = other.id;
123 ashish 4431
    }
4432
 
695 rajveer 4433
    public getPaymentGateway_args deepCopy() {
4434
      return new getPaymentGateway_args(this);
123 ashish 4435
    }
4436
 
4437
    @Deprecated
695 rajveer 4438
    public getPaymentGateway_args clone() {
4439
      return new getPaymentGateway_args(this);
123 ashish 4440
    }
4441
 
420 ashish 4442
    public long getId() {
4443
      return this.id;
123 ashish 4444
    }
4445
 
695 rajveer 4446
    public getPaymentGateway_args setId(long id) {
420 ashish 4447
      this.id = id;
4448
      setIdIsSet(true);
123 ashish 4449
      return this;
4450
    }
4451
 
420 ashish 4452
    public void unsetId() {
4453
      __isset_bit_vector.clear(__ID_ISSET_ID);
123 ashish 4454
    }
4455
 
420 ashish 4456
    /** Returns true if field id is set (has been asigned a value) and false otherwise */
4457
    public boolean isSetId() {
4458
      return __isset_bit_vector.get(__ID_ISSET_ID);
123 ashish 4459
    }
4460
 
420 ashish 4461
    public void setIdIsSet(boolean value) {
4462
      __isset_bit_vector.set(__ID_ISSET_ID, value);
123 ashish 4463
    }
4464
 
4465
    public void setFieldValue(_Fields field, Object value) {
4466
      switch (field) {
420 ashish 4467
      case ID:
123 ashish 4468
        if (value == null) {
420 ashish 4469
          unsetId();
123 ashish 4470
        } else {
420 ashish 4471
          setId((Long)value);
123 ashish 4472
        }
4473
        break;
4474
 
4475
      }
4476
    }
4477
 
4478
    public void setFieldValue(int fieldID, Object value) {
4479
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
4480
    }
4481
 
4482
    public Object getFieldValue(_Fields field) {
4483
      switch (field) {
420 ashish 4484
      case ID:
4485
        return new Long(getId());
123 ashish 4486
 
4487
      }
4488
      throw new IllegalStateException();
4489
    }
4490
 
4491
    public Object getFieldValue(int fieldId) {
4492
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
4493
    }
4494
 
4495
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
4496
    public boolean isSet(_Fields field) {
4497
      switch (field) {
420 ashish 4498
      case ID:
4499
        return isSetId();
123 ashish 4500
      }
4501
      throw new IllegalStateException();
4502
    }
4503
 
4504
    public boolean isSet(int fieldID) {
4505
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
4506
    }
4507
 
4508
    @Override
4509
    public boolean equals(Object that) {
4510
      if (that == null)
4511
        return false;
695 rajveer 4512
      if (that instanceof getPaymentGateway_args)
4513
        return this.equals((getPaymentGateway_args)that);
123 ashish 4514
      return false;
4515
    }
4516
 
695 rajveer 4517
    public boolean equals(getPaymentGateway_args that) {
123 ashish 4518
      if (that == null)
4519
        return false;
4520
 
420 ashish 4521
      boolean this_present_id = true;
4522
      boolean that_present_id = true;
4523
      if (this_present_id || that_present_id) {
4524
        if (!(this_present_id && that_present_id))
123 ashish 4525
          return false;
420 ashish 4526
        if (this.id != that.id)
123 ashish 4527
          return false;
4528
      }
4529
 
4530
      return true;
4531
    }
4532
 
4533
    @Override
4534
    public int hashCode() {
4535
      return 0;
4536
    }
4537
 
695 rajveer 4538
    public int compareTo(getPaymentGateway_args other) {
123 ashish 4539
      if (!getClass().equals(other.getClass())) {
4540
        return getClass().getName().compareTo(other.getClass().getName());
4541
      }
4542
 
4543
      int lastComparison = 0;
695 rajveer 4544
      getPaymentGateway_args typedOther = (getPaymentGateway_args)other;
123 ashish 4545
 
420 ashish 4546
      lastComparison = Boolean.valueOf(isSetId()).compareTo(isSetId());
123 ashish 4547
      if (lastComparison != 0) {
4548
        return lastComparison;
4549
      }
420 ashish 4550
      lastComparison = TBaseHelper.compareTo(id, typedOther.id);
123 ashish 4551
      if (lastComparison != 0) {
4552
        return lastComparison;
4553
      }
4554
      return 0;
4555
    }
4556
 
4557
    public void read(TProtocol iprot) throws TException {
4558
      TField field;
4559
      iprot.readStructBegin();
4560
      while (true)
4561
      {
4562
        field = iprot.readFieldBegin();
4563
        if (field.type == TType.STOP) { 
4564
          break;
4565
        }
4566
        _Fields fieldId = _Fields.findByThriftId(field.id);
4567
        if (fieldId == null) {
4568
          TProtocolUtil.skip(iprot, field.type);
4569
        } else {
4570
          switch (fieldId) {
420 ashish 4571
            case ID:
123 ashish 4572
              if (field.type == TType.I64) {
420 ashish 4573
                this.id = iprot.readI64();
4574
                setIdIsSet(true);
123 ashish 4575
              } else { 
4576
                TProtocolUtil.skip(iprot, field.type);
4577
              }
4578
              break;
4579
          }
4580
          iprot.readFieldEnd();
4581
        }
4582
      }
4583
      iprot.readStructEnd();
4584
      validate();
4585
    }
4586
 
4587
    public void write(TProtocol oprot) throws TException {
4588
      validate();
4589
 
4590
      oprot.writeStructBegin(STRUCT_DESC);
420 ashish 4591
      oprot.writeFieldBegin(ID_FIELD_DESC);
4592
      oprot.writeI64(this.id);
123 ashish 4593
      oprot.writeFieldEnd();
4594
      oprot.writeFieldStop();
4595
      oprot.writeStructEnd();
4596
    }
4597
 
4598
    @Override
4599
    public String toString() {
695 rajveer 4600
      StringBuilder sb = new StringBuilder("getPaymentGateway_args(");
123 ashish 4601
      boolean first = true;
4602
 
420 ashish 4603
      sb.append("id:");
4604
      sb.append(this.id);
123 ashish 4605
      first = false;
4606
      sb.append(")");
4607
      return sb.toString();
4608
    }
4609
 
4610
    public void validate() throws TException {
4611
      // check for required fields
4612
    }
4613
 
4614
  }
4615
 
695 rajveer 4616
  public static class getPaymentGateway_result implements TBase<getPaymentGateway_result._Fields>, java.io.Serializable, Cloneable, Comparable<getPaymentGateway_result>   {
4617
    private static final TStruct STRUCT_DESC = new TStruct("getPaymentGateway_result");
123 ashish 4618
 
695 rajveer 4619
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0);
123 ashish 4620
    private static final TField PE_FIELD_DESC = new TField("pe", TType.STRUCT, (short)1);
4621
 
695 rajveer 4622
    private PaymentGateway success;
123 ashish 4623
    private PaymentException pe;
4624
 
4625
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
4626
    public enum _Fields implements TFieldIdEnum {
420 ashish 4627
      SUCCESS((short)0, "success"),
4628
      PE((short)1, "pe");
4629
 
4630
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
4631
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4632
 
4633
      static {
4634
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4635
          byId.put((int)field._thriftId, field);
4636
          byName.put(field.getFieldName(), field);
4637
        }
4638
      }
4639
 
4640
      /**
4641
       * Find the _Fields constant that matches fieldId, or null if its not found.
4642
       */
4643
      public static _Fields findByThriftId(int fieldId) {
4644
        return byId.get(fieldId);
4645
      }
4646
 
4647
      /**
4648
       * Find the _Fields constant that matches fieldId, throwing an exception
4649
       * if it is not found.
4650
       */
4651
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4652
        _Fields fields = findByThriftId(fieldId);
4653
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4654
        return fields;
4655
      }
4656
 
4657
      /**
4658
       * Find the _Fields constant that matches name, or null if its not found.
4659
       */
4660
      public static _Fields findByName(String name) {
4661
        return byName.get(name);
4662
      }
4663
 
4664
      private final short _thriftId;
4665
      private final String _fieldName;
4666
 
4667
      _Fields(short thriftId, String fieldName) {
4668
        _thriftId = thriftId;
4669
        _fieldName = fieldName;
4670
      }
4671
 
4672
      public short getThriftFieldId() {
4673
        return _thriftId;
4674
      }
4675
 
4676
      public String getFieldName() {
4677
        return _fieldName;
4678
      }
4679
    }
4680
 
4681
    // isset id assignments
4682
 
4683
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
4684
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
695 rajveer 4685
          new StructMetaData(TType.STRUCT, PaymentGateway.class)));
420 ashish 4686
      put(_Fields.PE, new FieldMetaData("pe", TFieldRequirementType.DEFAULT, 
4687
          new FieldValueMetaData(TType.STRUCT)));
4688
    }});
4689
 
4690
    static {
695 rajveer 4691
      FieldMetaData.addStructMetaDataMap(getPaymentGateway_result.class, metaDataMap);
420 ashish 4692
    }
4693
 
695 rajveer 4694
    public getPaymentGateway_result() {
420 ashish 4695
    }
4696
 
695 rajveer 4697
    public getPaymentGateway_result(
4698
      PaymentGateway success,
420 ashish 4699
      PaymentException pe)
4700
    {
4701
      this();
4702
      this.success = success;
4703
      this.pe = pe;
4704
    }
4705
 
4706
    /**
4707
     * Performs a deep copy on <i>other</i>.
4708
     */
695 rajveer 4709
    public getPaymentGateway_result(getPaymentGateway_result other) {
420 ashish 4710
      if (other.isSetSuccess()) {
695 rajveer 4711
        this.success = new PaymentGateway(other.success);
420 ashish 4712
      }
4713
      if (other.isSetPe()) {
4714
        this.pe = new PaymentException(other.pe);
4715
      }
4716
    }
4717
 
695 rajveer 4718
    public getPaymentGateway_result deepCopy() {
4719
      return new getPaymentGateway_result(this);
420 ashish 4720
    }
4721
 
4722
    @Deprecated
695 rajveer 4723
    public getPaymentGateway_result clone() {
4724
      return new getPaymentGateway_result(this);
420 ashish 4725
    }
4726
 
695 rajveer 4727
    public PaymentGateway getSuccess() {
420 ashish 4728
      return this.success;
4729
    }
4730
 
695 rajveer 4731
    public getPaymentGateway_result setSuccess(PaymentGateway success) {
420 ashish 4732
      this.success = success;
4733
      return this;
4734
    }
4735
 
4736
    public void unsetSuccess() {
4737
      this.success = null;
4738
    }
4739
 
4740
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
4741
    public boolean isSetSuccess() {
4742
      return this.success != null;
4743
    }
4744
 
4745
    public void setSuccessIsSet(boolean value) {
4746
      if (!value) {
4747
        this.success = null;
4748
      }
4749
    }
4750
 
4751
    public PaymentException getPe() {
4752
      return this.pe;
4753
    }
4754
 
695 rajveer 4755
    public getPaymentGateway_result setPe(PaymentException pe) {
420 ashish 4756
      this.pe = pe;
4757
      return this;
4758
    }
4759
 
4760
    public void unsetPe() {
4761
      this.pe = null;
4762
    }
4763
 
4764
    /** Returns true if field pe is set (has been asigned a value) and false otherwise */
4765
    public boolean isSetPe() {
4766
      return this.pe != null;
4767
    }
4768
 
4769
    public void setPeIsSet(boolean value) {
4770
      if (!value) {
4771
        this.pe = null;
4772
      }
4773
    }
4774
 
4775
    public void setFieldValue(_Fields field, Object value) {
4776
      switch (field) {
4777
      case SUCCESS:
4778
        if (value == null) {
4779
          unsetSuccess();
4780
        } else {
695 rajveer 4781
          setSuccess((PaymentGateway)value);
420 ashish 4782
        }
4783
        break;
4784
 
4785
      case PE:
4786
        if (value == null) {
4787
          unsetPe();
4788
        } else {
4789
          setPe((PaymentException)value);
4790
        }
4791
        break;
4792
 
4793
      }
4794
    }
4795
 
4796
    public void setFieldValue(int fieldID, Object value) {
4797
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
4798
    }
4799
 
4800
    public Object getFieldValue(_Fields field) {
4801
      switch (field) {
4802
      case SUCCESS:
4803
        return getSuccess();
4804
 
4805
      case PE:
4806
        return getPe();
4807
 
4808
      }
4809
      throw new IllegalStateException();
4810
    }
4811
 
4812
    public Object getFieldValue(int fieldId) {
4813
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
4814
    }
4815
 
4816
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
4817
    public boolean isSet(_Fields field) {
4818
      switch (field) {
4819
      case SUCCESS:
4820
        return isSetSuccess();
4821
      case PE:
4822
        return isSetPe();
4823
      }
4824
      throw new IllegalStateException();
4825
    }
4826
 
4827
    public boolean isSet(int fieldID) {
4828
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
4829
    }
4830
 
4831
    @Override
4832
    public boolean equals(Object that) {
4833
      if (that == null)
4834
        return false;
695 rajveer 4835
      if (that instanceof getPaymentGateway_result)
4836
        return this.equals((getPaymentGateway_result)that);
420 ashish 4837
      return false;
4838
    }
4839
 
695 rajveer 4840
    public boolean equals(getPaymentGateway_result that) {
420 ashish 4841
      if (that == null)
4842
        return false;
4843
 
4844
      boolean this_present_success = true && this.isSetSuccess();
4845
      boolean that_present_success = true && that.isSetSuccess();
4846
      if (this_present_success || that_present_success) {
4847
        if (!(this_present_success && that_present_success))
4848
          return false;
4849
        if (!this.success.equals(that.success))
4850
          return false;
4851
      }
4852
 
4853
      boolean this_present_pe = true && this.isSetPe();
4854
      boolean that_present_pe = true && that.isSetPe();
4855
      if (this_present_pe || that_present_pe) {
4856
        if (!(this_present_pe && that_present_pe))
4857
          return false;
4858
        if (!this.pe.equals(that.pe))
4859
          return false;
4860
      }
4861
 
4862
      return true;
4863
    }
4864
 
4865
    @Override
4866
    public int hashCode() {
4867
      return 0;
4868
    }
4869
 
695 rajveer 4870
    public int compareTo(getPaymentGateway_result other) {
4871
      if (!getClass().equals(other.getClass())) {
4872
        return getClass().getName().compareTo(other.getClass().getName());
4873
      }
4874
 
4875
      int lastComparison = 0;
4876
      getPaymentGateway_result typedOther = (getPaymentGateway_result)other;
4877
 
4878
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
4879
      if (lastComparison != 0) {
4880
        return lastComparison;
4881
      }
4882
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
4883
      if (lastComparison != 0) {
4884
        return lastComparison;
4885
      }
4886
      lastComparison = Boolean.valueOf(isSetPe()).compareTo(isSetPe());
4887
      if (lastComparison != 0) {
4888
        return lastComparison;
4889
      }
4890
      lastComparison = TBaseHelper.compareTo(pe, typedOther.pe);
4891
      if (lastComparison != 0) {
4892
        return lastComparison;
4893
      }
4894
      return 0;
4895
    }
4896
 
420 ashish 4897
    public void read(TProtocol iprot) throws TException {
4898
      TField field;
4899
      iprot.readStructBegin();
4900
      while (true)
4901
      {
4902
        field = iprot.readFieldBegin();
4903
        if (field.type == TType.STOP) { 
4904
          break;
4905
        }
4906
        _Fields fieldId = _Fields.findByThriftId(field.id);
4907
        if (fieldId == null) {
4908
          TProtocolUtil.skip(iprot, field.type);
4909
        } else {
4910
          switch (fieldId) {
4911
            case SUCCESS:
695 rajveer 4912
              if (field.type == TType.STRUCT) {
4913
                this.success = new PaymentGateway();
4914
                this.success.read(iprot);
420 ashish 4915
              } else { 
4916
                TProtocolUtil.skip(iprot, field.type);
4917
              }
4918
              break;
4919
            case PE:
4920
              if (field.type == TType.STRUCT) {
4921
                this.pe = new PaymentException();
4922
                this.pe.read(iprot);
4923
              } else { 
4924
                TProtocolUtil.skip(iprot, field.type);
4925
              }
4926
              break;
4927
          }
4928
          iprot.readFieldEnd();
4929
        }
4930
      }
4931
      iprot.readStructEnd();
4932
      validate();
4933
    }
4934
 
4935
    public void write(TProtocol oprot) throws TException {
4936
      oprot.writeStructBegin(STRUCT_DESC);
4937
 
4938
      if (this.isSetSuccess()) {
4939
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
695 rajveer 4940
        this.success.write(oprot);
420 ashish 4941
        oprot.writeFieldEnd();
4942
      } else if (this.isSetPe()) {
4943
        oprot.writeFieldBegin(PE_FIELD_DESC);
4944
        this.pe.write(oprot);
4945
        oprot.writeFieldEnd();
4946
      }
4947
      oprot.writeFieldStop();
4948
      oprot.writeStructEnd();
4949
    }
4950
 
4951
    @Override
4952
    public String toString() {
695 rajveer 4953
      StringBuilder sb = new StringBuilder("getPaymentGateway_result(");
420 ashish 4954
      boolean first = true;
4955
 
4956
      sb.append("success:");
4957
      if (this.success == null) {
4958
        sb.append("null");
4959
      } else {
4960
        sb.append(this.success);
4961
      }
4962
      first = false;
4963
      if (!first) sb.append(", ");
4964
      sb.append("pe:");
4965
      if (this.pe == null) {
4966
        sb.append("null");
4967
      } else {
4968
        sb.append(this.pe);
4969
      }
4970
      first = false;
4971
      sb.append(")");
4972
      return sb.toString();
4973
    }
4974
 
4975
    public void validate() throws TException {
4976
      // check for required fields
4977
    }
4978
 
4979
  }
4980
 
695 rajveer 4981
  public static class getPayment_args implements TBase<getPayment_args._Fields>, java.io.Serializable, Cloneable, Comparable<getPayment_args>   {
4982
    private static final TStruct STRUCT_DESC = new TStruct("getPayment_args");
420 ashish 4983
 
4984
    private static final TField ID_FIELD_DESC = new TField("id", TType.I64, (short)1);
4985
 
4986
    private long id;
4987
 
4988
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
4989
    public enum _Fields implements TFieldIdEnum {
4990
      ID((short)1, "id");
4991
 
4992
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
4993
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4994
 
4995
      static {
4996
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4997
          byId.put((int)field._thriftId, field);
4998
          byName.put(field.getFieldName(), field);
4999
        }
5000
      }
5001
 
5002
      /**
5003
       * Find the _Fields constant that matches fieldId, or null if its not found.
5004
       */
5005
      public static _Fields findByThriftId(int fieldId) {
5006
        return byId.get(fieldId);
5007
      }
5008
 
5009
      /**
5010
       * Find the _Fields constant that matches fieldId, throwing an exception
5011
       * if it is not found.
5012
       */
5013
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5014
        _Fields fields = findByThriftId(fieldId);
5015
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5016
        return fields;
5017
      }
5018
 
5019
      /**
5020
       * Find the _Fields constant that matches name, or null if its not found.
5021
       */
5022
      public static _Fields findByName(String name) {
5023
        return byName.get(name);
5024
      }
5025
 
5026
      private final short _thriftId;
5027
      private final String _fieldName;
5028
 
5029
      _Fields(short thriftId, String fieldName) {
5030
        _thriftId = thriftId;
5031
        _fieldName = fieldName;
5032
      }
5033
 
5034
      public short getThriftFieldId() {
5035
        return _thriftId;
5036
      }
5037
 
5038
      public String getFieldName() {
5039
        return _fieldName;
5040
      }
5041
    }
5042
 
5043
    // isset id assignments
5044
    private static final int __ID_ISSET_ID = 0;
5045
    private BitSet __isset_bit_vector = new BitSet(1);
5046
 
5047
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
5048
      put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, 
5049
          new FieldValueMetaData(TType.I64)));
5050
    }});
5051
 
5052
    static {
695 rajveer 5053
      FieldMetaData.addStructMetaDataMap(getPayment_args.class, metaDataMap);
420 ashish 5054
    }
5055
 
695 rajveer 5056
    public getPayment_args() {
420 ashish 5057
    }
5058
 
695 rajveer 5059
    public getPayment_args(
420 ashish 5060
      long id)
5061
    {
5062
      this();
5063
      this.id = id;
5064
      setIdIsSet(true);
5065
    }
5066
 
5067
    /**
5068
     * Performs a deep copy on <i>other</i>.
5069
     */
695 rajveer 5070
    public getPayment_args(getPayment_args other) {
420 ashish 5071
      __isset_bit_vector.clear();
5072
      __isset_bit_vector.or(other.__isset_bit_vector);
5073
      this.id = other.id;
5074
    }
5075
 
695 rajveer 5076
    public getPayment_args deepCopy() {
5077
      return new getPayment_args(this);
420 ashish 5078
    }
5079
 
5080
    @Deprecated
695 rajveer 5081
    public getPayment_args clone() {
5082
      return new getPayment_args(this);
420 ashish 5083
    }
5084
 
5085
    public long getId() {
5086
      return this.id;
5087
    }
5088
 
695 rajveer 5089
    public getPayment_args setId(long id) {
420 ashish 5090
      this.id = id;
5091
      setIdIsSet(true);
5092
      return this;
5093
    }
5094
 
5095
    public void unsetId() {
5096
      __isset_bit_vector.clear(__ID_ISSET_ID);
5097
    }
5098
 
5099
    /** Returns true if field id is set (has been asigned a value) and false otherwise */
5100
    public boolean isSetId() {
5101
      return __isset_bit_vector.get(__ID_ISSET_ID);
5102
    }
5103
 
5104
    public void setIdIsSet(boolean value) {
5105
      __isset_bit_vector.set(__ID_ISSET_ID, value);
5106
    }
5107
 
5108
    public void setFieldValue(_Fields field, Object value) {
5109
      switch (field) {
5110
      case ID:
5111
        if (value == null) {
5112
          unsetId();
5113
        } else {
5114
          setId((Long)value);
5115
        }
5116
        break;
5117
 
5118
      }
5119
    }
5120
 
5121
    public void setFieldValue(int fieldID, Object value) {
5122
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
5123
    }
5124
 
5125
    public Object getFieldValue(_Fields field) {
5126
      switch (field) {
5127
      case ID:
5128
        return new Long(getId());
5129
 
5130
      }
5131
      throw new IllegalStateException();
5132
    }
5133
 
5134
    public Object getFieldValue(int fieldId) {
5135
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
5136
    }
5137
 
5138
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
5139
    public boolean isSet(_Fields field) {
5140
      switch (field) {
5141
      case ID:
5142
        return isSetId();
5143
      }
5144
      throw new IllegalStateException();
5145
    }
5146
 
5147
    public boolean isSet(int fieldID) {
5148
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
5149
    }
5150
 
5151
    @Override
5152
    public boolean equals(Object that) {
5153
      if (that == null)
5154
        return false;
695 rajveer 5155
      if (that instanceof getPayment_args)
5156
        return this.equals((getPayment_args)that);
420 ashish 5157
      return false;
5158
    }
5159
 
695 rajveer 5160
    public boolean equals(getPayment_args that) {
420 ashish 5161
      if (that == null)
5162
        return false;
5163
 
5164
      boolean this_present_id = true;
5165
      boolean that_present_id = true;
5166
      if (this_present_id || that_present_id) {
5167
        if (!(this_present_id && that_present_id))
5168
          return false;
5169
        if (this.id != that.id)
5170
          return false;
5171
      }
5172
 
5173
      return true;
5174
    }
5175
 
5176
    @Override
5177
    public int hashCode() {
5178
      return 0;
5179
    }
5180
 
695 rajveer 5181
    public int compareTo(getPayment_args other) {
420 ashish 5182
      if (!getClass().equals(other.getClass())) {
5183
        return getClass().getName().compareTo(other.getClass().getName());
5184
      }
5185
 
5186
      int lastComparison = 0;
695 rajveer 5187
      getPayment_args typedOther = (getPayment_args)other;
420 ashish 5188
 
5189
      lastComparison = Boolean.valueOf(isSetId()).compareTo(isSetId());
5190
      if (lastComparison != 0) {
5191
        return lastComparison;
5192
      }
5193
      lastComparison = TBaseHelper.compareTo(id, typedOther.id);
5194
      if (lastComparison != 0) {
5195
        return lastComparison;
5196
      }
5197
      return 0;
5198
    }
5199
 
5200
    public void read(TProtocol iprot) throws TException {
5201
      TField field;
5202
      iprot.readStructBegin();
5203
      while (true)
5204
      {
5205
        field = iprot.readFieldBegin();
5206
        if (field.type == TType.STOP) { 
5207
          break;
5208
        }
5209
        _Fields fieldId = _Fields.findByThriftId(field.id);
5210
        if (fieldId == null) {
5211
          TProtocolUtil.skip(iprot, field.type);
5212
        } else {
5213
          switch (fieldId) {
5214
            case ID:
5215
              if (field.type == TType.I64) {
5216
                this.id = iprot.readI64();
5217
                setIdIsSet(true);
5218
              } else { 
5219
                TProtocolUtil.skip(iprot, field.type);
5220
              }
5221
              break;
5222
          }
5223
          iprot.readFieldEnd();
5224
        }
5225
      }
5226
      iprot.readStructEnd();
5227
      validate();
5228
    }
5229
 
5230
    public void write(TProtocol oprot) throws TException {
5231
      validate();
5232
 
5233
      oprot.writeStructBegin(STRUCT_DESC);
5234
      oprot.writeFieldBegin(ID_FIELD_DESC);
5235
      oprot.writeI64(this.id);
5236
      oprot.writeFieldEnd();
5237
      oprot.writeFieldStop();
5238
      oprot.writeStructEnd();
5239
    }
5240
 
5241
    @Override
5242
    public String toString() {
695 rajveer 5243
      StringBuilder sb = new StringBuilder("getPayment_args(");
420 ashish 5244
      boolean first = true;
5245
 
5246
      sb.append("id:");
5247
      sb.append(this.id);
5248
      first = false;
5249
      sb.append(")");
5250
      return sb.toString();
5251
    }
5252
 
5253
    public void validate() throws TException {
5254
      // check for required fields
5255
    }
5256
 
5257
  }
5258
 
695 rajveer 5259
  public static class getPayment_result implements TBase<getPayment_result._Fields>, java.io.Serializable, Cloneable, Comparable<getPayment_result>   {
5260
    private static final TStruct STRUCT_DESC = new TStruct("getPayment_result");
420 ashish 5261
 
5262
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0);
5263
    private static final TField PE_FIELD_DESC = new TField("pe", TType.STRUCT, (short)1);
5264
 
695 rajveer 5265
    private Payment success;
420 ashish 5266
    private PaymentException pe;
5267
 
5268
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
5269
    public enum _Fields implements TFieldIdEnum {
5270
      SUCCESS((short)0, "success"),
5271
      PE((short)1, "pe");
5272
 
5273
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
5274
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5275
 
5276
      static {
5277
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5278
          byId.put((int)field._thriftId, field);
5279
          byName.put(field.getFieldName(), field);
5280
        }
5281
      }
5282
 
5283
      /**
5284
       * Find the _Fields constant that matches fieldId, or null if its not found.
5285
       */
5286
      public static _Fields findByThriftId(int fieldId) {
5287
        return byId.get(fieldId);
5288
      }
5289
 
5290
      /**
5291
       * Find the _Fields constant that matches fieldId, throwing an exception
5292
       * if it is not found.
5293
       */
5294
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5295
        _Fields fields = findByThriftId(fieldId);
5296
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5297
        return fields;
5298
      }
5299
 
5300
      /**
5301
       * Find the _Fields constant that matches name, or null if its not found.
5302
       */
5303
      public static _Fields findByName(String name) {
5304
        return byName.get(name);
5305
      }
5306
 
5307
      private final short _thriftId;
5308
      private final String _fieldName;
5309
 
5310
      _Fields(short thriftId, String fieldName) {
5311
        _thriftId = thriftId;
5312
        _fieldName = fieldName;
5313
      }
5314
 
5315
      public short getThriftFieldId() {
5316
        return _thriftId;
5317
      }
5318
 
5319
      public String getFieldName() {
5320
        return _fieldName;
5321
      }
5322
    }
5323
 
5324
    // isset id assignments
5325
 
5326
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
5327
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
695 rajveer 5328
          new StructMetaData(TType.STRUCT, Payment.class)));
420 ashish 5329
      put(_Fields.PE, new FieldMetaData("pe", TFieldRequirementType.DEFAULT, 
5330
          new FieldValueMetaData(TType.STRUCT)));
5331
    }});
5332
 
5333
    static {
695 rajveer 5334
      FieldMetaData.addStructMetaDataMap(getPayment_result.class, metaDataMap);
420 ashish 5335
    }
5336
 
695 rajveer 5337
    public getPayment_result() {
420 ashish 5338
    }
5339
 
695 rajveer 5340
    public getPayment_result(
5341
      Payment success,
420 ashish 5342
      PaymentException pe)
5343
    {
5344
      this();
5345
      this.success = success;
5346
      this.pe = pe;
5347
    }
5348
 
5349
    /**
5350
     * Performs a deep copy on <i>other</i>.
5351
     */
695 rajveer 5352
    public getPayment_result(getPayment_result other) {
420 ashish 5353
      if (other.isSetSuccess()) {
695 rajveer 5354
        this.success = new Payment(other.success);
420 ashish 5355
      }
5356
      if (other.isSetPe()) {
5357
        this.pe = new PaymentException(other.pe);
5358
      }
5359
    }
5360
 
695 rajveer 5361
    public getPayment_result deepCopy() {
5362
      return new getPayment_result(this);
420 ashish 5363
    }
5364
 
5365
    @Deprecated
695 rajveer 5366
    public getPayment_result clone() {
5367
      return new getPayment_result(this);
420 ashish 5368
    }
5369
 
695 rajveer 5370
    public Payment getSuccess() {
420 ashish 5371
      return this.success;
5372
    }
5373
 
695 rajveer 5374
    public getPayment_result setSuccess(Payment success) {
420 ashish 5375
      this.success = success;
5376
      return this;
5377
    }
5378
 
5379
    public void unsetSuccess() {
5380
      this.success = null;
5381
    }
5382
 
5383
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
5384
    public boolean isSetSuccess() {
5385
      return this.success != null;
5386
    }
5387
 
5388
    public void setSuccessIsSet(boolean value) {
5389
      if (!value) {
5390
        this.success = null;
5391
      }
5392
    }
5393
 
5394
    public PaymentException getPe() {
5395
      return this.pe;
5396
    }
5397
 
695 rajveer 5398
    public getPayment_result setPe(PaymentException pe) {
420 ashish 5399
      this.pe = pe;
5400
      return this;
5401
    }
5402
 
5403
    public void unsetPe() {
5404
      this.pe = null;
5405
    }
5406
 
5407
    /** Returns true if field pe is set (has been asigned a value) and false otherwise */
5408
    public boolean isSetPe() {
5409
      return this.pe != null;
5410
    }
5411
 
5412
    public void setPeIsSet(boolean value) {
5413
      if (!value) {
5414
        this.pe = null;
5415
      }
5416
    }
5417
 
5418
    public void setFieldValue(_Fields field, Object value) {
5419
      switch (field) {
5420
      case SUCCESS:
5421
        if (value == null) {
5422
          unsetSuccess();
5423
        } else {
695 rajveer 5424
          setSuccess((Payment)value);
420 ashish 5425
        }
5426
        break;
5427
 
5428
      case PE:
5429
        if (value == null) {
5430
          unsetPe();
5431
        } else {
5432
          setPe((PaymentException)value);
5433
        }
5434
        break;
5435
 
5436
      }
5437
    }
5438
 
5439
    public void setFieldValue(int fieldID, Object value) {
5440
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
5441
    }
5442
 
5443
    public Object getFieldValue(_Fields field) {
5444
      switch (field) {
5445
      case SUCCESS:
5446
        return getSuccess();
5447
 
5448
      case PE:
5449
        return getPe();
5450
 
5451
      }
5452
      throw new IllegalStateException();
5453
    }
5454
 
5455
    public Object getFieldValue(int fieldId) {
5456
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
5457
    }
5458
 
5459
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
5460
    public boolean isSet(_Fields field) {
5461
      switch (field) {
5462
      case SUCCESS:
5463
        return isSetSuccess();
5464
      case PE:
5465
        return isSetPe();
5466
      }
5467
      throw new IllegalStateException();
5468
    }
5469
 
5470
    public boolean isSet(int fieldID) {
5471
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
5472
    }
5473
 
5474
    @Override
5475
    public boolean equals(Object that) {
5476
      if (that == null)
5477
        return false;
695 rajveer 5478
      if (that instanceof getPayment_result)
5479
        return this.equals((getPayment_result)that);
420 ashish 5480
      return false;
5481
    }
5482
 
695 rajveer 5483
    public boolean equals(getPayment_result that) {
420 ashish 5484
      if (that == null)
5485
        return false;
5486
 
5487
      boolean this_present_success = true && this.isSetSuccess();
5488
      boolean that_present_success = true && that.isSetSuccess();
5489
      if (this_present_success || that_present_success) {
5490
        if (!(this_present_success && that_present_success))
5491
          return false;
5492
        if (!this.success.equals(that.success))
5493
          return false;
5494
      }
5495
 
5496
      boolean this_present_pe = true && this.isSetPe();
5497
      boolean that_present_pe = true && that.isSetPe();
5498
      if (this_present_pe || that_present_pe) {
5499
        if (!(this_present_pe && that_present_pe))
5500
          return false;
5501
        if (!this.pe.equals(that.pe))
5502
          return false;
5503
      }
5504
 
5505
      return true;
5506
    }
5507
 
5508
    @Override
5509
    public int hashCode() {
5510
      return 0;
5511
    }
5512
 
695 rajveer 5513
    public int compareTo(getPayment_result other) {
420 ashish 5514
      if (!getClass().equals(other.getClass())) {
5515
        return getClass().getName().compareTo(other.getClass().getName());
5516
      }
5517
 
5518
      int lastComparison = 0;
695 rajveer 5519
      getPayment_result typedOther = (getPayment_result)other;
420 ashish 5520
 
695 rajveer 5521
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
420 ashish 5522
      if (lastComparison != 0) {
5523
        return lastComparison;
5524
      }
695 rajveer 5525
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
420 ashish 5526
      if (lastComparison != 0) {
5527
        return lastComparison;
5528
      }
695 rajveer 5529
      lastComparison = Boolean.valueOf(isSetPe()).compareTo(isSetPe());
420 ashish 5530
      if (lastComparison != 0) {
5531
        return lastComparison;
5532
      }
695 rajveer 5533
      lastComparison = TBaseHelper.compareTo(pe, typedOther.pe);
420 ashish 5534
      if (lastComparison != 0) {
5535
        return lastComparison;
5536
      }
5537
      return 0;
5538
    }
5539
 
5540
    public void read(TProtocol iprot) throws TException {
5541
      TField field;
5542
      iprot.readStructBegin();
5543
      while (true)
5544
      {
5545
        field = iprot.readFieldBegin();
5546
        if (field.type == TType.STOP) { 
5547
          break;
5548
        }
5549
        _Fields fieldId = _Fields.findByThriftId(field.id);
5550
        if (fieldId == null) {
5551
          TProtocolUtil.skip(iprot, field.type);
5552
        } else {
5553
          switch (fieldId) {
695 rajveer 5554
            case SUCCESS:
5555
              if (field.type == TType.STRUCT) {
5556
                this.success = new Payment();
5557
                this.success.read(iprot);
420 ashish 5558
              } else { 
5559
                TProtocolUtil.skip(iprot, field.type);
5560
              }
5561
              break;
5562
            case PE:
5563
              if (field.type == TType.STRUCT) {
5564
                this.pe = new PaymentException();
5565
                this.pe.read(iprot);
5566
              } else { 
5567
                TProtocolUtil.skip(iprot, field.type);
5568
              }
5569
              break;
5570
          }
5571
          iprot.readFieldEnd();
5572
        }
5573
      }
5574
      iprot.readStructEnd();
5575
      validate();
5576
    }
5577
 
5578
    public void write(TProtocol oprot) throws TException {
5579
      oprot.writeStructBegin(STRUCT_DESC);
5580
 
695 rajveer 5581
      if (this.isSetSuccess()) {
5582
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
5583
        this.success.write(oprot);
5584
        oprot.writeFieldEnd();
5585
      } else if (this.isSetPe()) {
420 ashish 5586
        oprot.writeFieldBegin(PE_FIELD_DESC);
5587
        this.pe.write(oprot);
5588
        oprot.writeFieldEnd();
5589
      }
5590
      oprot.writeFieldStop();
5591
      oprot.writeStructEnd();
5592
    }
5593
 
5594
    @Override
5595
    public String toString() {
695 rajveer 5596
      StringBuilder sb = new StringBuilder("getPayment_result(");
420 ashish 5597
      boolean first = true;
5598
 
695 rajveer 5599
      sb.append("success:");
5600
      if (this.success == null) {
5601
        sb.append("null");
5602
      } else {
5603
        sb.append(this.success);
5604
      }
5605
      first = false;
5606
      if (!first) sb.append(", ");
420 ashish 5607
      sb.append("pe:");
5608
      if (this.pe == null) {
5609
        sb.append("null");
5610
      } else {
5611
        sb.append(this.pe);
5612
      }
5613
      first = false;
5614
      sb.append(")");
5615
      return sb.toString();
5616
    }
5617
 
5618
    public void validate() throws TException {
5619
      // check for required fields
5620
    }
5621
 
5622
  }
5623
 
695 rajveer 5624
  public static class getPaymentForTxnId_args implements TBase<getPaymentForTxnId_args._Fields>, java.io.Serializable, Cloneable, Comparable<getPaymentForTxnId_args>   {
5625
    private static final TStruct STRUCT_DESC = new TStruct("getPaymentForTxnId_args");
420 ashish 5626
 
695 rajveer 5627
    private static final TField TXN_ID_FIELD_DESC = new TField("txnId", TType.I64, (short)1);
420 ashish 5628
 
695 rajveer 5629
    private long txnId;
420 ashish 5630
 
5631
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
5632
    public enum _Fields implements TFieldIdEnum {
695 rajveer 5633
      TXN_ID((short)1, "txnId");
420 ashish 5634
 
5635
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
5636
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5637
 
5638
      static {
5639
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5640
          byId.put((int)field._thriftId, field);
5641
          byName.put(field.getFieldName(), field);
5642
        }
5643
      }
5644
 
5645
      /**
5646
       * Find the _Fields constant that matches fieldId, or null if its not found.
5647
       */
5648
      public static _Fields findByThriftId(int fieldId) {
5649
        return byId.get(fieldId);
5650
      }
5651
 
5652
      /**
5653
       * Find the _Fields constant that matches fieldId, throwing an exception
5654
       * if it is not found.
5655
       */
5656
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5657
        _Fields fields = findByThriftId(fieldId);
5658
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5659
        return fields;
5660
      }
5661
 
5662
      /**
5663
       * Find the _Fields constant that matches name, or null if its not found.
5664
       */
5665
      public static _Fields findByName(String name) {
5666
        return byName.get(name);
5667
      }
5668
 
5669
      private final short _thriftId;
5670
      private final String _fieldName;
5671
 
5672
      _Fields(short thriftId, String fieldName) {
5673
        _thriftId = thriftId;
5674
        _fieldName = fieldName;
5675
      }
5676
 
5677
      public short getThriftFieldId() {
5678
        return _thriftId;
5679
      }
5680
 
5681
      public String getFieldName() {
5682
        return _fieldName;
5683
      }
5684
    }
5685
 
5686
    // isset id assignments
695 rajveer 5687
    private static final int __TXNID_ISSET_ID = 0;
420 ashish 5688
    private BitSet __isset_bit_vector = new BitSet(1);
5689
 
5690
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
695 rajveer 5691
      put(_Fields.TXN_ID, new FieldMetaData("txnId", TFieldRequirementType.DEFAULT, 
420 ashish 5692
          new FieldValueMetaData(TType.I64)));
5693
    }});
5694
 
5695
    static {
695 rajveer 5696
      FieldMetaData.addStructMetaDataMap(getPaymentForTxnId_args.class, metaDataMap);
420 ashish 5697
    }
5698
 
695 rajveer 5699
    public getPaymentForTxnId_args() {
420 ashish 5700
    }
5701
 
695 rajveer 5702
    public getPaymentForTxnId_args(
5703
      long txnId)
420 ashish 5704
    {
5705
      this();
695 rajveer 5706
      this.txnId = txnId;
5707
      setTxnIdIsSet(true);
420 ashish 5708
    }
5709
 
5710
    /**
5711
     * Performs a deep copy on <i>other</i>.
5712
     */
695 rajveer 5713
    public getPaymentForTxnId_args(getPaymentForTxnId_args other) {
420 ashish 5714
      __isset_bit_vector.clear();
5715
      __isset_bit_vector.or(other.__isset_bit_vector);
695 rajveer 5716
      this.txnId = other.txnId;
420 ashish 5717
    }
5718
 
695 rajveer 5719
    public getPaymentForTxnId_args deepCopy() {
5720
      return new getPaymentForTxnId_args(this);
420 ashish 5721
    }
5722
 
5723
    @Deprecated
695 rajveer 5724
    public getPaymentForTxnId_args clone() {
5725
      return new getPaymentForTxnId_args(this);
420 ashish 5726
    }
5727
 
695 rajveer 5728
    public long getTxnId() {
5729
      return this.txnId;
420 ashish 5730
    }
5731
 
695 rajveer 5732
    public getPaymentForTxnId_args setTxnId(long txnId) {
5733
      this.txnId = txnId;
5734
      setTxnIdIsSet(true);
420 ashish 5735
      return this;
5736
    }
5737
 
695 rajveer 5738
    public void unsetTxnId() {
5739
      __isset_bit_vector.clear(__TXNID_ISSET_ID);
420 ashish 5740
    }
5741
 
695 rajveer 5742
    /** Returns true if field txnId is set (has been asigned a value) and false otherwise */
5743
    public boolean isSetTxnId() {
5744
      return __isset_bit_vector.get(__TXNID_ISSET_ID);
420 ashish 5745
    }
5746
 
695 rajveer 5747
    public void setTxnIdIsSet(boolean value) {
5748
      __isset_bit_vector.set(__TXNID_ISSET_ID, value);
420 ashish 5749
    }
5750
 
5751
    public void setFieldValue(_Fields field, Object value) {
5752
      switch (field) {
695 rajveer 5753
      case TXN_ID:
420 ashish 5754
        if (value == null) {
695 rajveer 5755
          unsetTxnId();
420 ashish 5756
        } else {
695 rajveer 5757
          setTxnId((Long)value);
420 ashish 5758
        }
5759
        break;
5760
 
5761
      }
5762
    }
5763
 
5764
    public void setFieldValue(int fieldID, Object value) {
5765
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
5766
    }
5767
 
5768
    public Object getFieldValue(_Fields field) {
5769
      switch (field) {
695 rajveer 5770
      case TXN_ID:
5771
        return new Long(getTxnId());
420 ashish 5772
 
5773
      }
5774
      throw new IllegalStateException();
5775
    }
5776
 
5777
    public Object getFieldValue(int fieldId) {
5778
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
5779
    }
5780
 
5781
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
5782
    public boolean isSet(_Fields field) {
5783
      switch (field) {
695 rajveer 5784
      case TXN_ID:
5785
        return isSetTxnId();
420 ashish 5786
      }
5787
      throw new IllegalStateException();
5788
    }
5789
 
5790
    public boolean isSet(int fieldID) {
5791
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
5792
    }
5793
 
5794
    @Override
5795
    public boolean equals(Object that) {
5796
      if (that == null)
5797
        return false;
695 rajveer 5798
      if (that instanceof getPaymentForTxnId_args)
5799
        return this.equals((getPaymentForTxnId_args)that);
420 ashish 5800
      return false;
5801
    }
5802
 
695 rajveer 5803
    public boolean equals(getPaymentForTxnId_args that) {
420 ashish 5804
      if (that == null)
5805
        return false;
5806
 
695 rajveer 5807
      boolean this_present_txnId = true;
5808
      boolean that_present_txnId = true;
5809
      if (this_present_txnId || that_present_txnId) {
5810
        if (!(this_present_txnId && that_present_txnId))
420 ashish 5811
          return false;
695 rajveer 5812
        if (this.txnId != that.txnId)
420 ashish 5813
          return false;
5814
      }
5815
 
5816
      return true;
5817
    }
5818
 
5819
    @Override
5820
    public int hashCode() {
5821
      return 0;
5822
    }
5823
 
695 rajveer 5824
    public int compareTo(getPaymentForTxnId_args other) {
420 ashish 5825
      if (!getClass().equals(other.getClass())) {
5826
        return getClass().getName().compareTo(other.getClass().getName());
5827
      }
5828
 
5829
      int lastComparison = 0;
695 rajveer 5830
      getPaymentForTxnId_args typedOther = (getPaymentForTxnId_args)other;
420 ashish 5831
 
695 rajveer 5832
      lastComparison = Boolean.valueOf(isSetTxnId()).compareTo(isSetTxnId());
420 ashish 5833
      if (lastComparison != 0) {
5834
        return lastComparison;
5835
      }
695 rajveer 5836
      lastComparison = TBaseHelper.compareTo(txnId, typedOther.txnId);
420 ashish 5837
      if (lastComparison != 0) {
5838
        return lastComparison;
5839
      }
5840
      return 0;
5841
    }
5842
 
5843
    public void read(TProtocol iprot) throws TException {
5844
      TField field;
5845
      iprot.readStructBegin();
5846
      while (true)
5847
      {
5848
        field = iprot.readFieldBegin();
5849
        if (field.type == TType.STOP) { 
5850
          break;
5851
        }
5852
        _Fields fieldId = _Fields.findByThriftId(field.id);
5853
        if (fieldId == null) {
5854
          TProtocolUtil.skip(iprot, field.type);
5855
        } else {
5856
          switch (fieldId) {
695 rajveer 5857
            case TXN_ID:
420 ashish 5858
              if (field.type == TType.I64) {
695 rajveer 5859
                this.txnId = iprot.readI64();
5860
                setTxnIdIsSet(true);
420 ashish 5861
              } else { 
5862
                TProtocolUtil.skip(iprot, field.type);
5863
              }
5864
              break;
5865
          }
5866
          iprot.readFieldEnd();
5867
        }
5868
      }
5869
      iprot.readStructEnd();
5870
      validate();
5871
    }
5872
 
5873
    public void write(TProtocol oprot) throws TException {
5874
      validate();
5875
 
5876
      oprot.writeStructBegin(STRUCT_DESC);
695 rajveer 5877
      oprot.writeFieldBegin(TXN_ID_FIELD_DESC);
5878
      oprot.writeI64(this.txnId);
420 ashish 5879
      oprot.writeFieldEnd();
5880
      oprot.writeFieldStop();
5881
      oprot.writeStructEnd();
5882
    }
5883
 
5884
    @Override
5885
    public String toString() {
695 rajveer 5886
      StringBuilder sb = new StringBuilder("getPaymentForTxnId_args(");
420 ashish 5887
      boolean first = true;
5888
 
695 rajveer 5889
      sb.append("txnId:");
5890
      sb.append(this.txnId);
420 ashish 5891
      first = false;
5892
      sb.append(")");
5893
      return sb.toString();
5894
    }
5895
 
5896
    public void validate() throws TException {
5897
      // check for required fields
5898
    }
5899
 
5900
  }
5901
 
695 rajveer 5902
  public static class getPaymentForTxnId_result implements TBase<getPaymentForTxnId_result._Fields>, java.io.Serializable, Cloneable, Comparable<getPaymentForTxnId_result>   {
5903
    private static final TStruct STRUCT_DESC = new TStruct("getPaymentForTxnId_result");
420 ashish 5904
 
695 rajveer 5905
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0);
420 ashish 5906
    private static final TField PE_FIELD_DESC = new TField("pe", TType.STRUCT, (short)1);
5907
 
695 rajveer 5908
    private List<Payment> success;
420 ashish 5909
    private PaymentException pe;
5910
 
5911
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
5912
    public enum _Fields implements TFieldIdEnum {
5913
      SUCCESS((short)0, "success"),
5914
      PE((short)1, "pe");
5915
 
5916
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
5917
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5918
 
5919
      static {
5920
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5921
          byId.put((int)field._thriftId, field);
5922
          byName.put(field.getFieldName(), field);
5923
        }
5924
      }
5925
 
5926
      /**
5927
       * Find the _Fields constant that matches fieldId, or null if its not found.
5928
       */
5929
      public static _Fields findByThriftId(int fieldId) {
5930
        return byId.get(fieldId);
5931
      }
5932
 
5933
      /**
5934
       * Find the _Fields constant that matches fieldId, throwing an exception
5935
       * if it is not found.
5936
       */
5937
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5938
        _Fields fields = findByThriftId(fieldId);
5939
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5940
        return fields;
5941
      }
5942
 
5943
      /**
5944
       * Find the _Fields constant that matches name, or null if its not found.
5945
       */
5946
      public static _Fields findByName(String name) {
5947
        return byName.get(name);
5948
      }
5949
 
5950
      private final short _thriftId;
5951
      private final String _fieldName;
5952
 
5953
      _Fields(short thriftId, String fieldName) {
5954
        _thriftId = thriftId;
5955
        _fieldName = fieldName;
5956
      }
5957
 
5958
      public short getThriftFieldId() {
5959
        return _thriftId;
5960
      }
5961
 
5962
      public String getFieldName() {
5963
        return _fieldName;
5964
      }
5965
    }
5966
 
5967
    // isset id assignments
5968
 
5969
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
5970
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
695 rajveer 5971
          new ListMetaData(TType.LIST, 
5972
              new StructMetaData(TType.STRUCT, Payment.class))));
420 ashish 5973
      put(_Fields.PE, new FieldMetaData("pe", TFieldRequirementType.DEFAULT, 
5974
          new FieldValueMetaData(TType.STRUCT)));
5975
    }});
5976
 
5977
    static {
695 rajveer 5978
      FieldMetaData.addStructMetaDataMap(getPaymentForTxnId_result.class, metaDataMap);
420 ashish 5979
    }
5980
 
695 rajveer 5981
    public getPaymentForTxnId_result() {
420 ashish 5982
    }
5983
 
695 rajveer 5984
    public getPaymentForTxnId_result(
5985
      List<Payment> success,
420 ashish 5986
      PaymentException pe)
5987
    {
5988
      this();
5989
      this.success = success;
5990
      this.pe = pe;
5991
    }
5992
 
5993
    /**
5994
     * Performs a deep copy on <i>other</i>.
5995
     */
695 rajveer 5996
    public getPaymentForTxnId_result(getPaymentForTxnId_result other) {
420 ashish 5997
      if (other.isSetSuccess()) {
695 rajveer 5998
        List<Payment> __this__success = new ArrayList<Payment>();
5999
        for (Payment other_element : other.success) {
6000
          __this__success.add(new Payment(other_element));
6001
        }
6002
        this.success = __this__success;
420 ashish 6003
      }
6004
      if (other.isSetPe()) {
6005
        this.pe = new PaymentException(other.pe);
6006
      }
6007
    }
6008
 
695 rajveer 6009
    public getPaymentForTxnId_result deepCopy() {
6010
      return new getPaymentForTxnId_result(this);
420 ashish 6011
    }
6012
 
6013
    @Deprecated
695 rajveer 6014
    public getPaymentForTxnId_result clone() {
6015
      return new getPaymentForTxnId_result(this);
420 ashish 6016
    }
6017
 
695 rajveer 6018
    public int getSuccessSize() {
6019
      return (this.success == null) ? 0 : this.success.size();
6020
    }
6021
 
6022
    public java.util.Iterator<Payment> getSuccessIterator() {
6023
      return (this.success == null) ? null : this.success.iterator();
6024
    }
6025
 
6026
    public void addToSuccess(Payment elem) {
6027
      if (this.success == null) {
6028
        this.success = new ArrayList<Payment>();
6029
      }
6030
      this.success.add(elem);
6031
    }
6032
 
6033
    public List<Payment> getSuccess() {
420 ashish 6034
      return this.success;
6035
    }
6036
 
695 rajveer 6037
    public getPaymentForTxnId_result setSuccess(List<Payment> success) {
420 ashish 6038
      this.success = success;
6039
      return this;
6040
    }
6041
 
6042
    public void unsetSuccess() {
6043
      this.success = null;
6044
    }
6045
 
6046
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
6047
    public boolean isSetSuccess() {
6048
      return this.success != null;
6049
    }
6050
 
6051
    public void setSuccessIsSet(boolean value) {
6052
      if (!value) {
6053
        this.success = null;
6054
      }
6055
    }
6056
 
6057
    public PaymentException getPe() {
6058
      return this.pe;
6059
    }
6060
 
695 rajveer 6061
    public getPaymentForTxnId_result setPe(PaymentException pe) {
420 ashish 6062
      this.pe = pe;
6063
      return this;
6064
    }
6065
 
6066
    public void unsetPe() {
6067
      this.pe = null;
6068
    }
6069
 
6070
    /** Returns true if field pe is set (has been asigned a value) and false otherwise */
6071
    public boolean isSetPe() {
6072
      return this.pe != null;
6073
    }
6074
 
6075
    public void setPeIsSet(boolean value) {
6076
      if (!value) {
6077
        this.pe = null;
6078
      }
6079
    }
6080
 
6081
    public void setFieldValue(_Fields field, Object value) {
6082
      switch (field) {
6083
      case SUCCESS:
6084
        if (value == null) {
6085
          unsetSuccess();
6086
        } else {
695 rajveer 6087
          setSuccess((List<Payment>)value);
420 ashish 6088
        }
6089
        break;
6090
 
6091
      case PE:
6092
        if (value == null) {
6093
          unsetPe();
6094
        } else {
6095
          setPe((PaymentException)value);
6096
        }
6097
        break;
6098
 
6099
      }
6100
    }
6101
 
6102
    public void setFieldValue(int fieldID, Object value) {
6103
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
6104
    }
6105
 
6106
    public Object getFieldValue(_Fields field) {
6107
      switch (field) {
6108
      case SUCCESS:
6109
        return getSuccess();
6110
 
6111
      case PE:
6112
        return getPe();
6113
 
6114
      }
6115
      throw new IllegalStateException();
6116
    }
6117
 
6118
    public Object getFieldValue(int fieldId) {
6119
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
6120
    }
6121
 
6122
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
6123
    public boolean isSet(_Fields field) {
6124
      switch (field) {
6125
      case SUCCESS:
6126
        return isSetSuccess();
6127
      case PE:
6128
        return isSetPe();
6129
      }
6130
      throw new IllegalStateException();
6131
    }
6132
 
6133
    public boolean isSet(int fieldID) {
6134
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
6135
    }
6136
 
6137
    @Override
6138
    public boolean equals(Object that) {
6139
      if (that == null)
6140
        return false;
695 rajveer 6141
      if (that instanceof getPaymentForTxnId_result)
6142
        return this.equals((getPaymentForTxnId_result)that);
420 ashish 6143
      return false;
6144
    }
6145
 
695 rajveer 6146
    public boolean equals(getPaymentForTxnId_result that) {
420 ashish 6147
      if (that == null)
6148
        return false;
6149
 
6150
      boolean this_present_success = true && this.isSetSuccess();
6151
      boolean that_present_success = true && that.isSetSuccess();
6152
      if (this_present_success || that_present_success) {
6153
        if (!(this_present_success && that_present_success))
6154
          return false;
6155
        if (!this.success.equals(that.success))
6156
          return false;
6157
      }
6158
 
6159
      boolean this_present_pe = true && this.isSetPe();
6160
      boolean that_present_pe = true && that.isSetPe();
6161
      if (this_present_pe || that_present_pe) {
6162
        if (!(this_present_pe && that_present_pe))
6163
          return false;
6164
        if (!this.pe.equals(that.pe))
6165
          return false;
6166
      }
6167
 
6168
      return true;
6169
    }
6170
 
6171
    @Override
6172
    public int hashCode() {
6173
      return 0;
6174
    }
6175
 
695 rajveer 6176
    public int compareTo(getPaymentForTxnId_result other) {
6177
      if (!getClass().equals(other.getClass())) {
6178
        return getClass().getName().compareTo(other.getClass().getName());
6179
      }
6180
 
6181
      int lastComparison = 0;
6182
      getPaymentForTxnId_result typedOther = (getPaymentForTxnId_result)other;
6183
 
6184
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
6185
      if (lastComparison != 0) {
6186
        return lastComparison;
6187
      }
6188
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
6189
      if (lastComparison != 0) {
6190
        return lastComparison;
6191
      }
6192
      lastComparison = Boolean.valueOf(isSetPe()).compareTo(isSetPe());
6193
      if (lastComparison != 0) {
6194
        return lastComparison;
6195
      }
6196
      lastComparison = TBaseHelper.compareTo(pe, typedOther.pe);
6197
      if (lastComparison != 0) {
6198
        return lastComparison;
6199
      }
6200
      return 0;
6201
    }
6202
 
420 ashish 6203
    public void read(TProtocol iprot) throws TException {
6204
      TField field;
6205
      iprot.readStructBegin();
6206
      while (true)
6207
      {
6208
        field = iprot.readFieldBegin();
6209
        if (field.type == TType.STOP) { 
6210
          break;
6211
        }
6212
        _Fields fieldId = _Fields.findByThriftId(field.id);
6213
        if (fieldId == null) {
6214
          TProtocolUtil.skip(iprot, field.type);
6215
        } else {
6216
          switch (fieldId) {
6217
            case SUCCESS:
695 rajveer 6218
              if (field.type == TType.LIST) {
6219
                {
6220
                  TList _list16 = iprot.readListBegin();
6221
                  this.success = new ArrayList<Payment>(_list16.size);
6222
                  for (int _i17 = 0; _i17 < _list16.size; ++_i17)
6223
                  {
6224
                    Payment _elem18;
6225
                    _elem18 = new Payment();
6226
                    _elem18.read(iprot);
6227
                    this.success.add(_elem18);
6228
                  }
6229
                  iprot.readListEnd();
6230
                }
420 ashish 6231
              } else { 
6232
                TProtocolUtil.skip(iprot, field.type);
6233
              }
6234
              break;
6235
            case PE:
6236
              if (field.type == TType.STRUCT) {
6237
                this.pe = new PaymentException();
6238
                this.pe.read(iprot);
6239
              } else { 
6240
                TProtocolUtil.skip(iprot, field.type);
6241
              }
6242
              break;
6243
          }
6244
          iprot.readFieldEnd();
6245
        }
6246
      }
6247
      iprot.readStructEnd();
6248
      validate();
6249
    }
6250
 
6251
    public void write(TProtocol oprot) throws TException {
6252
      oprot.writeStructBegin(STRUCT_DESC);
6253
 
6254
      if (this.isSetSuccess()) {
6255
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
695 rajveer 6256
        {
6257
          oprot.writeListBegin(new TList(TType.STRUCT, this.success.size()));
6258
          for (Payment _iter19 : this.success)
6259
          {
6260
            _iter19.write(oprot);
6261
          }
6262
          oprot.writeListEnd();
6263
        }
420 ashish 6264
        oprot.writeFieldEnd();
6265
      } else if (this.isSetPe()) {
6266
        oprot.writeFieldBegin(PE_FIELD_DESC);
6267
        this.pe.write(oprot);
6268
        oprot.writeFieldEnd();
6269
      }
6270
      oprot.writeFieldStop();
6271
      oprot.writeStructEnd();
6272
    }
6273
 
6274
    @Override
6275
    public String toString() {
695 rajveer 6276
      StringBuilder sb = new StringBuilder("getPaymentForTxnId_result(");
420 ashish 6277
      boolean first = true;
6278
 
6279
      sb.append("success:");
6280
      if (this.success == null) {
6281
        sb.append("null");
6282
      } else {
6283
        sb.append(this.success);
6284
      }
6285
      first = false;
6286
      if (!first) sb.append(", ");
6287
      sb.append("pe:");
6288
      if (this.pe == null) {
6289
        sb.append("null");
6290
      } else {
6291
        sb.append(this.pe);
6292
      }
6293
      first = false;
6294
      sb.append(")");
6295
      return sb.toString();
6296
    }
6297
 
6298
    public void validate() throws TException {
6299
      // check for required fields
6300
    }
6301
 
6302
  }
6303
 
695 rajveer 6304
  public static class updatePaymentDetails_args implements TBase<updatePaymentDetails_args._Fields>, java.io.Serializable, Cloneable, Comparable<updatePaymentDetails_args>   {
6305
    private static final TStruct STRUCT_DESC = new TStruct("updatePaymentDetails_args");
420 ashish 6306
 
6307
    private static final TField ID_FIELD_DESC = new TField("id", TType.I64, (short)1);
695 rajveer 6308
    private static final TField GATEWAY_PAYMENT_ID_FIELD_DESC = new TField("gatewayPaymentId", TType.STRING, (short)2);
6309
    private static final TField SESSION_ID_FIELD_DESC = new TField("sessionId", TType.STRING, (short)3);
6310
    private static final TField GATEWAY_TXN_STATUS_FIELD_DESC = new TField("gatewayTxnStatus", TType.STRING, (short)4);
6311
    private static final TField DESCRIPTION_FIELD_DESC = new TField("description", TType.STRING, (short)5);
6312
    private static final TField GATEWAY_TXN_ID_FIELD_DESC = new TField("gatewayTxnId", TType.STRING, (short)6);
6313
    private static final TField AUTH_CODE_FIELD_DESC = new TField("authCode", TType.STRING, (short)7);
6314
    private static final TField REFERENCE_CODE_FIELD_DESC = new TField("referenceCode", TType.STRING, (short)8);
6315
    private static final TField ERROR_CODE_FIELD_DESC = new TField("errorCode", TType.STRING, (short)9);
6316
    private static final TField STATUS_FIELD_DESC = new TField("status", TType.I32, (short)10);
1119 rajveer 6317
    private static final TField GATEWAY_TXN_DATE_FIELD_DESC = new TField("gatewayTxnDate", TType.STRING, (short)11);
6318
    private static final TField ATTRIBUTES_FIELD_DESC = new TField("attributes", TType.LIST, (short)12);
420 ashish 6319
 
6320
    private long id;
695 rajveer 6321
    private String gatewayPaymentId;
6322
    private String sessionId;
6323
    private String gatewayTxnStatus;
6324
    private String description;
6325
    private String gatewayTxnId;
6326
    private String authCode;
6327
    private String referenceCode;
6328
    private String errorCode;
6329
    private PaymentStatus status;
1119 rajveer 6330
    private String gatewayTxnDate;
695 rajveer 6331
    private List<Attribute> attributes;
420 ashish 6332
 
6333
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
6334
    public enum _Fields implements TFieldIdEnum {
6335
      ID((short)1, "id"),
695 rajveer 6336
      GATEWAY_PAYMENT_ID((short)2, "gatewayPaymentId"),
6337
      SESSION_ID((short)3, "sessionId"),
6338
      GATEWAY_TXN_STATUS((short)4, "gatewayTxnStatus"),
6339
      DESCRIPTION((short)5, "description"),
6340
      GATEWAY_TXN_ID((short)6, "gatewayTxnId"),
6341
      AUTH_CODE((short)7, "authCode"),
6342
      REFERENCE_CODE((short)8, "referenceCode"),
6343
      ERROR_CODE((short)9, "errorCode"),
6344
      /**
6345
       * 
6346
       * @see PaymentStatus
6347
       */
6348
      STATUS((short)10, "status"),
1119 rajveer 6349
      GATEWAY_TXN_DATE((short)11, "gatewayTxnDate"),
6350
      ATTRIBUTES((short)12, "attributes");
420 ashish 6351
 
6352
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
6353
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6354
 
6355
      static {
6356
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6357
          byId.put((int)field._thriftId, field);
6358
          byName.put(field.getFieldName(), field);
6359
        }
6360
      }
6361
 
6362
      /**
6363
       * Find the _Fields constant that matches fieldId, or null if its not found.
6364
       */
6365
      public static _Fields findByThriftId(int fieldId) {
6366
        return byId.get(fieldId);
6367
      }
6368
 
6369
      /**
6370
       * Find the _Fields constant that matches fieldId, throwing an exception
6371
       * if it is not found.
6372
       */
6373
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6374
        _Fields fields = findByThriftId(fieldId);
6375
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6376
        return fields;
6377
      }
6378
 
6379
      /**
6380
       * Find the _Fields constant that matches name, or null if its not found.
6381
       */
6382
      public static _Fields findByName(String name) {
6383
        return byName.get(name);
6384
      }
6385
 
6386
      private final short _thriftId;
6387
      private final String _fieldName;
6388
 
6389
      _Fields(short thriftId, String fieldName) {
6390
        _thriftId = thriftId;
6391
        _fieldName = fieldName;
6392
      }
6393
 
6394
      public short getThriftFieldId() {
6395
        return _thriftId;
6396
      }
6397
 
6398
      public String getFieldName() {
6399
        return _fieldName;
6400
      }
6401
    }
6402
 
6403
    // isset id assignments
6404
    private static final int __ID_ISSET_ID = 0;
6405
    private BitSet __isset_bit_vector = new BitSet(1);
6406
 
6407
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
6408
      put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, 
6409
          new FieldValueMetaData(TType.I64)));
695 rajveer 6410
      put(_Fields.GATEWAY_PAYMENT_ID, new FieldMetaData("gatewayPaymentId", TFieldRequirementType.DEFAULT, 
420 ashish 6411
          new FieldValueMetaData(TType.STRING)));
695 rajveer 6412
      put(_Fields.SESSION_ID, new FieldMetaData("sessionId", TFieldRequirementType.DEFAULT, 
420 ashish 6413
          new FieldValueMetaData(TType.STRING)));
695 rajveer 6414
      put(_Fields.GATEWAY_TXN_STATUS, new FieldMetaData("gatewayTxnStatus", TFieldRequirementType.DEFAULT, 
420 ashish 6415
          new FieldValueMetaData(TType.STRING)));
695 rajveer 6416
      put(_Fields.DESCRIPTION, new FieldMetaData("description", TFieldRequirementType.DEFAULT, 
420 ashish 6417
          new FieldValueMetaData(TType.STRING)));
695 rajveer 6418
      put(_Fields.GATEWAY_TXN_ID, new FieldMetaData("gatewayTxnId", TFieldRequirementType.DEFAULT, 
420 ashish 6419
          new FieldValueMetaData(TType.STRING)));
695 rajveer 6420
      put(_Fields.AUTH_CODE, new FieldMetaData("authCode", TFieldRequirementType.DEFAULT, 
420 ashish 6421
          new FieldValueMetaData(TType.STRING)));
695 rajveer 6422
      put(_Fields.REFERENCE_CODE, new FieldMetaData("referenceCode", TFieldRequirementType.DEFAULT, 
420 ashish 6423
          new FieldValueMetaData(TType.STRING)));
695 rajveer 6424
      put(_Fields.ERROR_CODE, new FieldMetaData("errorCode", TFieldRequirementType.DEFAULT, 
6425
          new FieldValueMetaData(TType.STRING)));
6426
      put(_Fields.STATUS, new FieldMetaData("status", TFieldRequirementType.DEFAULT, 
6427
          new EnumMetaData(TType.ENUM, PaymentStatus.class)));
1119 rajveer 6428
      put(_Fields.GATEWAY_TXN_DATE, new FieldMetaData("gatewayTxnDate", TFieldRequirementType.DEFAULT, 
6429
          new FieldValueMetaData(TType.STRING)));
695 rajveer 6430
      put(_Fields.ATTRIBUTES, new FieldMetaData("attributes", TFieldRequirementType.DEFAULT, 
6431
          new ListMetaData(TType.LIST, 
6432
              new StructMetaData(TType.STRUCT, Attribute.class))));
420 ashish 6433
    }});
6434
 
6435
    static {
695 rajveer 6436
      FieldMetaData.addStructMetaDataMap(updatePaymentDetails_args.class, metaDataMap);
420 ashish 6437
    }
6438
 
695 rajveer 6439
    public updatePaymentDetails_args() {
420 ashish 6440
    }
6441
 
695 rajveer 6442
    public updatePaymentDetails_args(
420 ashish 6443
      long id,
695 rajveer 6444
      String gatewayPaymentId,
6445
      String sessionId,
6446
      String gatewayTxnStatus,
6447
      String description,
6448
      String gatewayTxnId,
6449
      String authCode,
6450
      String referenceCode,
6451
      String errorCode,
6452
      PaymentStatus status,
1119 rajveer 6453
      String gatewayTxnDate,
695 rajveer 6454
      List<Attribute> attributes)
420 ashish 6455
    {
6456
      this();
6457
      this.id = id;
6458
      setIdIsSet(true);
695 rajveer 6459
      this.gatewayPaymentId = gatewayPaymentId;
6460
      this.sessionId = sessionId;
6461
      this.gatewayTxnStatus = gatewayTxnStatus;
6462
      this.description = description;
6463
      this.gatewayTxnId = gatewayTxnId;
6464
      this.authCode = authCode;
6465
      this.referenceCode = referenceCode;
6466
      this.errorCode = errorCode;
6467
      this.status = status;
1119 rajveer 6468
      this.gatewayTxnDate = gatewayTxnDate;
695 rajveer 6469
      this.attributes = attributes;
420 ashish 6470
    }
6471
 
6472
    /**
6473
     * Performs a deep copy on <i>other</i>.
6474
     */
695 rajveer 6475
    public updatePaymentDetails_args(updatePaymentDetails_args other) {
420 ashish 6476
      __isset_bit_vector.clear();
6477
      __isset_bit_vector.or(other.__isset_bit_vector);
6478
      this.id = other.id;
695 rajveer 6479
      if (other.isSetGatewayPaymentId()) {
6480
        this.gatewayPaymentId = other.gatewayPaymentId;
420 ashish 6481
      }
695 rajveer 6482
      if (other.isSetSessionId()) {
6483
        this.sessionId = other.sessionId;
420 ashish 6484
      }
695 rajveer 6485
      if (other.isSetGatewayTxnStatus()) {
6486
        this.gatewayTxnStatus = other.gatewayTxnStatus;
420 ashish 6487
      }
695 rajveer 6488
      if (other.isSetDescription()) {
6489
        this.description = other.description;
420 ashish 6490
      }
695 rajveer 6491
      if (other.isSetGatewayTxnId()) {
6492
        this.gatewayTxnId = other.gatewayTxnId;
420 ashish 6493
      }
695 rajveer 6494
      if (other.isSetAuthCode()) {
6495
        this.authCode = other.authCode;
420 ashish 6496
      }
695 rajveer 6497
      if (other.isSetReferenceCode()) {
6498
        this.referenceCode = other.referenceCode;
420 ashish 6499
      }
695 rajveer 6500
      if (other.isSetErrorCode()) {
6501
        this.errorCode = other.errorCode;
6502
      }
6503
      if (other.isSetStatus()) {
6504
        this.status = other.status;
6505
      }
1119 rajveer 6506
      if (other.isSetGatewayTxnDate()) {
6507
        this.gatewayTxnDate = other.gatewayTxnDate;
6508
      }
695 rajveer 6509
      if (other.isSetAttributes()) {
6510
        List<Attribute> __this__attributes = new ArrayList<Attribute>();
6511
        for (Attribute other_element : other.attributes) {
6512
          __this__attributes.add(new Attribute(other_element));
6513
        }
6514
        this.attributes = __this__attributes;
6515
      }
420 ashish 6516
    }
6517
 
695 rajveer 6518
    public updatePaymentDetails_args deepCopy() {
6519
      return new updatePaymentDetails_args(this);
420 ashish 6520
    }
6521
 
6522
    @Deprecated
695 rajveer 6523
    public updatePaymentDetails_args clone() {
6524
      return new updatePaymentDetails_args(this);
420 ashish 6525
    }
6526
 
6527
    public long getId() {
6528
      return this.id;
6529
    }
6530
 
695 rajveer 6531
    public updatePaymentDetails_args setId(long id) {
420 ashish 6532
      this.id = id;
6533
      setIdIsSet(true);
6534
      return this;
6535
    }
6536
 
6537
    public void unsetId() {
6538
      __isset_bit_vector.clear(__ID_ISSET_ID);
6539
    }
6540
 
6541
    /** Returns true if field id is set (has been asigned a value) and false otherwise */
6542
    public boolean isSetId() {
6543
      return __isset_bit_vector.get(__ID_ISSET_ID);
6544
    }
6545
 
6546
    public void setIdIsSet(boolean value) {
6547
      __isset_bit_vector.set(__ID_ISSET_ID, value);
6548
    }
6549
 
695 rajveer 6550
    public String getGatewayPaymentId() {
6551
      return this.gatewayPaymentId;
420 ashish 6552
    }
6553
 
695 rajveer 6554
    public updatePaymentDetails_args setGatewayPaymentId(String gatewayPaymentId) {
6555
      this.gatewayPaymentId = gatewayPaymentId;
420 ashish 6556
      return this;
6557
    }
6558
 
695 rajveer 6559
    public void unsetGatewayPaymentId() {
6560
      this.gatewayPaymentId = null;
420 ashish 6561
    }
6562
 
695 rajveer 6563
    /** Returns true if field gatewayPaymentId is set (has been asigned a value) and false otherwise */
6564
    public boolean isSetGatewayPaymentId() {
6565
      return this.gatewayPaymentId != null;
420 ashish 6566
    }
6567
 
695 rajveer 6568
    public void setGatewayPaymentIdIsSet(boolean value) {
420 ashish 6569
      if (!value) {
695 rajveer 6570
        this.gatewayPaymentId = null;
420 ashish 6571
      }
6572
    }
6573
 
695 rajveer 6574
    public String getSessionId() {
6575
      return this.sessionId;
420 ashish 6576
    }
6577
 
695 rajveer 6578
    public updatePaymentDetails_args setSessionId(String sessionId) {
6579
      this.sessionId = sessionId;
420 ashish 6580
      return this;
6581
    }
6582
 
695 rajveer 6583
    public void unsetSessionId() {
6584
      this.sessionId = null;
420 ashish 6585
    }
6586
 
695 rajveer 6587
    /** Returns true if field sessionId is set (has been asigned a value) and false otherwise */
6588
    public boolean isSetSessionId() {
6589
      return this.sessionId != null;
420 ashish 6590
    }
6591
 
695 rajveer 6592
    public void setSessionIdIsSet(boolean value) {
420 ashish 6593
      if (!value) {
695 rajveer 6594
        this.sessionId = null;
420 ashish 6595
      }
6596
    }
6597
 
695 rajveer 6598
    public String getGatewayTxnStatus() {
6599
      return this.gatewayTxnStatus;
420 ashish 6600
    }
6601
 
695 rajveer 6602
    public updatePaymentDetails_args setGatewayTxnStatus(String gatewayTxnStatus) {
6603
      this.gatewayTxnStatus = gatewayTxnStatus;
420 ashish 6604
      return this;
6605
    }
6606
 
695 rajveer 6607
    public void unsetGatewayTxnStatus() {
6608
      this.gatewayTxnStatus = null;
420 ashish 6609
    }
6610
 
695 rajveer 6611
    /** Returns true if field gatewayTxnStatus is set (has been asigned a value) and false otherwise */
6612
    public boolean isSetGatewayTxnStatus() {
6613
      return this.gatewayTxnStatus != null;
420 ashish 6614
    }
6615
 
695 rajveer 6616
    public void setGatewayTxnStatusIsSet(boolean value) {
420 ashish 6617
      if (!value) {
695 rajveer 6618
        this.gatewayTxnStatus = null;
420 ashish 6619
      }
6620
    }
6621
 
695 rajveer 6622
    public String getDescription() {
6623
      return this.description;
420 ashish 6624
    }
6625
 
695 rajveer 6626
    public updatePaymentDetails_args setDescription(String description) {
6627
      this.description = description;
420 ashish 6628
      return this;
6629
    }
6630
 
695 rajveer 6631
    public void unsetDescription() {
6632
      this.description = null;
420 ashish 6633
    }
6634
 
695 rajveer 6635
    /** Returns true if field description is set (has been asigned a value) and false otherwise */
6636
    public boolean isSetDescription() {
6637
      return this.description != null;
420 ashish 6638
    }
6639
 
695 rajveer 6640
    public void setDescriptionIsSet(boolean value) {
420 ashish 6641
      if (!value) {
695 rajveer 6642
        this.description = null;
420 ashish 6643
      }
6644
    }
6645
 
695 rajveer 6646
    public String getGatewayTxnId() {
6647
      return this.gatewayTxnId;
420 ashish 6648
    }
6649
 
695 rajveer 6650
    public updatePaymentDetails_args setGatewayTxnId(String gatewayTxnId) {
6651
      this.gatewayTxnId = gatewayTxnId;
420 ashish 6652
      return this;
6653
    }
6654
 
695 rajveer 6655
    public void unsetGatewayTxnId() {
6656
      this.gatewayTxnId = null;
420 ashish 6657
    }
6658
 
695 rajveer 6659
    /** Returns true if field gatewayTxnId is set (has been asigned a value) and false otherwise */
6660
    public boolean isSetGatewayTxnId() {
6661
      return this.gatewayTxnId != null;
420 ashish 6662
    }
6663
 
695 rajveer 6664
    public void setGatewayTxnIdIsSet(boolean value) {
420 ashish 6665
      if (!value) {
695 rajveer 6666
        this.gatewayTxnId = null;
420 ashish 6667
      }
6668
    }
6669
 
695 rajveer 6670
    public String getAuthCode() {
6671
      return this.authCode;
420 ashish 6672
    }
6673
 
695 rajveer 6674
    public updatePaymentDetails_args setAuthCode(String authCode) {
6675
      this.authCode = authCode;
420 ashish 6676
      return this;
6677
    }
6678
 
695 rajveer 6679
    public void unsetAuthCode() {
6680
      this.authCode = null;
420 ashish 6681
    }
6682
 
695 rajveer 6683
    /** Returns true if field authCode is set (has been asigned a value) and false otherwise */
6684
    public boolean isSetAuthCode() {
6685
      return this.authCode != null;
420 ashish 6686
    }
6687
 
695 rajveer 6688
    public void setAuthCodeIsSet(boolean value) {
420 ashish 6689
      if (!value) {
695 rajveer 6690
        this.authCode = null;
420 ashish 6691
      }
6692
    }
6693
 
695 rajveer 6694
    public String getReferenceCode() {
6695
      return this.referenceCode;
420 ashish 6696
    }
6697
 
695 rajveer 6698
    public updatePaymentDetails_args setReferenceCode(String referenceCode) {
6699
      this.referenceCode = referenceCode;
420 ashish 6700
      return this;
6701
    }
6702
 
695 rajveer 6703
    public void unsetReferenceCode() {
6704
      this.referenceCode = null;
420 ashish 6705
    }
6706
 
695 rajveer 6707
    /** Returns true if field referenceCode is set (has been asigned a value) and false otherwise */
6708
    public boolean isSetReferenceCode() {
6709
      return this.referenceCode != null;
420 ashish 6710
    }
6711
 
695 rajveer 6712
    public void setReferenceCodeIsSet(boolean value) {
420 ashish 6713
      if (!value) {
695 rajveer 6714
        this.referenceCode = null;
420 ashish 6715
      }
6716
    }
6717
 
695 rajveer 6718
    public String getErrorCode() {
6719
      return this.errorCode;
6720
    }
6721
 
6722
    public updatePaymentDetails_args setErrorCode(String errorCode) {
6723
      this.errorCode = errorCode;
6724
      return this;
6725
    }
6726
 
6727
    public void unsetErrorCode() {
6728
      this.errorCode = null;
6729
    }
6730
 
6731
    /** Returns true if field errorCode is set (has been asigned a value) and false otherwise */
6732
    public boolean isSetErrorCode() {
6733
      return this.errorCode != null;
6734
    }
6735
 
6736
    public void setErrorCodeIsSet(boolean value) {
6737
      if (!value) {
6738
        this.errorCode = null;
6739
      }
6740
    }
6741
 
6742
    /**
6743
     * 
6744
     * @see PaymentStatus
6745
     */
6746
    public PaymentStatus getStatus() {
6747
      return this.status;
6748
    }
6749
 
6750
    /**
6751
     * 
6752
     * @see PaymentStatus
6753
     */
6754
    public updatePaymentDetails_args setStatus(PaymentStatus status) {
6755
      this.status = status;
6756
      return this;
6757
    }
6758
 
6759
    public void unsetStatus() {
6760
      this.status = null;
6761
    }
6762
 
6763
    /** Returns true if field status is set (has been asigned a value) and false otherwise */
6764
    public boolean isSetStatus() {
6765
      return this.status != null;
6766
    }
6767
 
6768
    public void setStatusIsSet(boolean value) {
6769
      if (!value) {
6770
        this.status = null;
6771
      }
6772
    }
6773
 
1119 rajveer 6774
    public String getGatewayTxnDate() {
6775
      return this.gatewayTxnDate;
6776
    }
6777
 
6778
    public updatePaymentDetails_args setGatewayTxnDate(String gatewayTxnDate) {
6779
      this.gatewayTxnDate = gatewayTxnDate;
6780
      return this;
6781
    }
6782
 
6783
    public void unsetGatewayTxnDate() {
6784
      this.gatewayTxnDate = null;
6785
    }
6786
 
6787
    /** Returns true if field gatewayTxnDate is set (has been asigned a value) and false otherwise */
6788
    public boolean isSetGatewayTxnDate() {
6789
      return this.gatewayTxnDate != null;
6790
    }
6791
 
6792
    public void setGatewayTxnDateIsSet(boolean value) {
6793
      if (!value) {
6794
        this.gatewayTxnDate = null;
6795
      }
6796
    }
6797
 
695 rajveer 6798
    public int getAttributesSize() {
6799
      return (this.attributes == null) ? 0 : this.attributes.size();
6800
    }
6801
 
6802
    public java.util.Iterator<Attribute> getAttributesIterator() {
6803
      return (this.attributes == null) ? null : this.attributes.iterator();
6804
    }
6805
 
6806
    public void addToAttributes(Attribute elem) {
6807
      if (this.attributes == null) {
6808
        this.attributes = new ArrayList<Attribute>();
6809
      }
6810
      this.attributes.add(elem);
6811
    }
6812
 
6813
    public List<Attribute> getAttributes() {
6814
      return this.attributes;
6815
    }
6816
 
6817
    public updatePaymentDetails_args setAttributes(List<Attribute> attributes) {
6818
      this.attributes = attributes;
6819
      return this;
6820
    }
6821
 
6822
    public void unsetAttributes() {
6823
      this.attributes = null;
6824
    }
6825
 
6826
    /** Returns true if field attributes is set (has been asigned a value) and false otherwise */
6827
    public boolean isSetAttributes() {
6828
      return this.attributes != null;
6829
    }
6830
 
6831
    public void setAttributesIsSet(boolean value) {
6832
      if (!value) {
6833
        this.attributes = null;
6834
      }
6835
    }
6836
 
420 ashish 6837
    public void setFieldValue(_Fields field, Object value) {
6838
      switch (field) {
6839
      case ID:
6840
        if (value == null) {
6841
          unsetId();
6842
        } else {
6843
          setId((Long)value);
6844
        }
6845
        break;
6846
 
695 rajveer 6847
      case GATEWAY_PAYMENT_ID:
420 ashish 6848
        if (value == null) {
695 rajveer 6849
          unsetGatewayPaymentId();
420 ashish 6850
        } else {
695 rajveer 6851
          setGatewayPaymentId((String)value);
420 ashish 6852
        }
6853
        break;
6854
 
695 rajveer 6855
      case SESSION_ID:
420 ashish 6856
        if (value == null) {
695 rajveer 6857
          unsetSessionId();
420 ashish 6858
        } else {
695 rajveer 6859
          setSessionId((String)value);
420 ashish 6860
        }
6861
        break;
6862
 
695 rajveer 6863
      case GATEWAY_TXN_STATUS:
420 ashish 6864
        if (value == null) {
695 rajveer 6865
          unsetGatewayTxnStatus();
420 ashish 6866
        } else {
695 rajveer 6867
          setGatewayTxnStatus((String)value);
420 ashish 6868
        }
6869
        break;
6870
 
695 rajveer 6871
      case DESCRIPTION:
420 ashish 6872
        if (value == null) {
695 rajveer 6873
          unsetDescription();
420 ashish 6874
        } else {
695 rajveer 6875
          setDescription((String)value);
420 ashish 6876
        }
6877
        break;
6878
 
695 rajveer 6879
      case GATEWAY_TXN_ID:
420 ashish 6880
        if (value == null) {
695 rajveer 6881
          unsetGatewayTxnId();
420 ashish 6882
        } else {
695 rajveer 6883
          setGatewayTxnId((String)value);
420 ashish 6884
        }
6885
        break;
6886
 
6887
      case AUTH_CODE:
6888
        if (value == null) {
695 rajveer 6889
          unsetAuthCode();
420 ashish 6890
        } else {
695 rajveer 6891
          setAuthCode((String)value);
420 ashish 6892
        }
6893
        break;
6894
 
695 rajveer 6895
      case REFERENCE_CODE:
420 ashish 6896
        if (value == null) {
695 rajveer 6897
          unsetReferenceCode();
420 ashish 6898
        } else {
695 rajveer 6899
          setReferenceCode((String)value);
420 ashish 6900
        }
6901
        break;
6902
 
695 rajveer 6903
      case ERROR_CODE:
6904
        if (value == null) {
6905
          unsetErrorCode();
6906
        } else {
6907
          setErrorCode((String)value);
6908
        }
6909
        break;
6910
 
6911
      case STATUS:
6912
        if (value == null) {
6913
          unsetStatus();
6914
        } else {
6915
          setStatus((PaymentStatus)value);
6916
        }
6917
        break;
6918
 
1119 rajveer 6919
      case GATEWAY_TXN_DATE:
6920
        if (value == null) {
6921
          unsetGatewayTxnDate();
6922
        } else {
6923
          setGatewayTxnDate((String)value);
6924
        }
6925
        break;
6926
 
695 rajveer 6927
      case ATTRIBUTES:
6928
        if (value == null) {
6929
          unsetAttributes();
6930
        } else {
6931
          setAttributes((List<Attribute>)value);
6932
        }
6933
        break;
6934
 
420 ashish 6935
      }
6936
    }
6937
 
6938
    public void setFieldValue(int fieldID, Object value) {
6939
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
6940
    }
6941
 
6942
    public Object getFieldValue(_Fields field) {
6943
      switch (field) {
6944
      case ID:
6945
        return new Long(getId());
6946
 
695 rajveer 6947
      case GATEWAY_PAYMENT_ID:
6948
        return getGatewayPaymentId();
420 ashish 6949
 
695 rajveer 6950
      case SESSION_ID:
6951
        return getSessionId();
420 ashish 6952
 
695 rajveer 6953
      case GATEWAY_TXN_STATUS:
6954
        return getGatewayTxnStatus();
420 ashish 6955
 
695 rajveer 6956
      case DESCRIPTION:
6957
        return getDescription();
420 ashish 6958
 
695 rajveer 6959
      case GATEWAY_TXN_ID:
6960
        return getGatewayTxnId();
420 ashish 6961
 
6962
      case AUTH_CODE:
695 rajveer 6963
        return getAuthCode();
420 ashish 6964
 
695 rajveer 6965
      case REFERENCE_CODE:
6966
        return getReferenceCode();
420 ashish 6967
 
695 rajveer 6968
      case ERROR_CODE:
6969
        return getErrorCode();
6970
 
6971
      case STATUS:
6972
        return getStatus();
6973
 
1119 rajveer 6974
      case GATEWAY_TXN_DATE:
6975
        return getGatewayTxnDate();
6976
 
695 rajveer 6977
      case ATTRIBUTES:
6978
        return getAttributes();
6979
 
420 ashish 6980
      }
6981
      throw new IllegalStateException();
6982
    }
6983
 
6984
    public Object getFieldValue(int fieldId) {
6985
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
6986
    }
6987
 
6988
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
6989
    public boolean isSet(_Fields field) {
6990
      switch (field) {
6991
      case ID:
6992
        return isSetId();
695 rajveer 6993
      case GATEWAY_PAYMENT_ID:
6994
        return isSetGatewayPaymentId();
420 ashish 6995
      case SESSION_ID:
695 rajveer 6996
        return isSetSessionId();
6997
      case GATEWAY_TXN_STATUS:
6998
        return isSetGatewayTxnStatus();
6999
      case DESCRIPTION:
7000
        return isSetDescription();
7001
      case GATEWAY_TXN_ID:
7002
        return isSetGatewayTxnId();
420 ashish 7003
      case AUTH_CODE:
695 rajveer 7004
        return isSetAuthCode();
7005
      case REFERENCE_CODE:
7006
        return isSetReferenceCode();
7007
      case ERROR_CODE:
7008
        return isSetErrorCode();
7009
      case STATUS:
7010
        return isSetStatus();
1119 rajveer 7011
      case GATEWAY_TXN_DATE:
7012
        return isSetGatewayTxnDate();
695 rajveer 7013
      case ATTRIBUTES:
7014
        return isSetAttributes();
420 ashish 7015
      }
7016
      throw new IllegalStateException();
7017
    }
7018
 
7019
    public boolean isSet(int fieldID) {
7020
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
7021
    }
7022
 
7023
    @Override
7024
    public boolean equals(Object that) {
7025
      if (that == null)
7026
        return false;
695 rajveer 7027
      if (that instanceof updatePaymentDetails_args)
7028
        return this.equals((updatePaymentDetails_args)that);
420 ashish 7029
      return false;
7030
    }
7031
 
695 rajveer 7032
    public boolean equals(updatePaymentDetails_args that) {
420 ashish 7033
      if (that == null)
7034
        return false;
7035
 
7036
      boolean this_present_id = true;
7037
      boolean that_present_id = true;
7038
      if (this_present_id || that_present_id) {
7039
        if (!(this_present_id && that_present_id))
7040
          return false;
7041
        if (this.id != that.id)
7042
          return false;
7043
      }
7044
 
695 rajveer 7045
      boolean this_present_gatewayPaymentId = true && this.isSetGatewayPaymentId();
7046
      boolean that_present_gatewayPaymentId = true && that.isSetGatewayPaymentId();
7047
      if (this_present_gatewayPaymentId || that_present_gatewayPaymentId) {
7048
        if (!(this_present_gatewayPaymentId && that_present_gatewayPaymentId))
420 ashish 7049
          return false;
695 rajveer 7050
        if (!this.gatewayPaymentId.equals(that.gatewayPaymentId))
420 ashish 7051
          return false;
7052
      }
7053
 
695 rajveer 7054
      boolean this_present_sessionId = true && this.isSetSessionId();
7055
      boolean that_present_sessionId = true && that.isSetSessionId();
7056
      if (this_present_sessionId || that_present_sessionId) {
7057
        if (!(this_present_sessionId && that_present_sessionId))
420 ashish 7058
          return false;
695 rajveer 7059
        if (!this.sessionId.equals(that.sessionId))
420 ashish 7060
          return false;
7061
      }
7062
 
695 rajveer 7063
      boolean this_present_gatewayTxnStatus = true && this.isSetGatewayTxnStatus();
7064
      boolean that_present_gatewayTxnStatus = true && that.isSetGatewayTxnStatus();
7065
      if (this_present_gatewayTxnStatus || that_present_gatewayTxnStatus) {
7066
        if (!(this_present_gatewayTxnStatus && that_present_gatewayTxnStatus))
420 ashish 7067
          return false;
695 rajveer 7068
        if (!this.gatewayTxnStatus.equals(that.gatewayTxnStatus))
420 ashish 7069
          return false;
7070
      }
7071
 
695 rajveer 7072
      boolean this_present_description = true && this.isSetDescription();
7073
      boolean that_present_description = true && that.isSetDescription();
7074
      if (this_present_description || that_present_description) {
7075
        if (!(this_present_description && that_present_description))
420 ashish 7076
          return false;
695 rajveer 7077
        if (!this.description.equals(that.description))
420 ashish 7078
          return false;
7079
      }
7080
 
695 rajveer 7081
      boolean this_present_gatewayTxnId = true && this.isSetGatewayTxnId();
7082
      boolean that_present_gatewayTxnId = true && that.isSetGatewayTxnId();
7083
      if (this_present_gatewayTxnId || that_present_gatewayTxnId) {
7084
        if (!(this_present_gatewayTxnId && that_present_gatewayTxnId))
420 ashish 7085
          return false;
695 rajveer 7086
        if (!this.gatewayTxnId.equals(that.gatewayTxnId))
420 ashish 7087
          return false;
7088
      }
7089
 
695 rajveer 7090
      boolean this_present_authCode = true && this.isSetAuthCode();
7091
      boolean that_present_authCode = true && that.isSetAuthCode();
7092
      if (this_present_authCode || that_present_authCode) {
7093
        if (!(this_present_authCode && that_present_authCode))
420 ashish 7094
          return false;
695 rajveer 7095
        if (!this.authCode.equals(that.authCode))
420 ashish 7096
          return false;
7097
      }
7098
 
695 rajveer 7099
      boolean this_present_referenceCode = true && this.isSetReferenceCode();
7100
      boolean that_present_referenceCode = true && that.isSetReferenceCode();
7101
      if (this_present_referenceCode || that_present_referenceCode) {
7102
        if (!(this_present_referenceCode && that_present_referenceCode))
420 ashish 7103
          return false;
695 rajveer 7104
        if (!this.referenceCode.equals(that.referenceCode))
420 ashish 7105
          return false;
7106
      }
7107
 
695 rajveer 7108
      boolean this_present_errorCode = true && this.isSetErrorCode();
7109
      boolean that_present_errorCode = true && that.isSetErrorCode();
7110
      if (this_present_errorCode || that_present_errorCode) {
7111
        if (!(this_present_errorCode && that_present_errorCode))
7112
          return false;
7113
        if (!this.errorCode.equals(that.errorCode))
7114
          return false;
7115
      }
7116
 
7117
      boolean this_present_status = true && this.isSetStatus();
7118
      boolean that_present_status = true && that.isSetStatus();
7119
      if (this_present_status || that_present_status) {
7120
        if (!(this_present_status && that_present_status))
7121
          return false;
7122
        if (!this.status.equals(that.status))
7123
          return false;
7124
      }
7125
 
1119 rajveer 7126
      boolean this_present_gatewayTxnDate = true && this.isSetGatewayTxnDate();
7127
      boolean that_present_gatewayTxnDate = true && that.isSetGatewayTxnDate();
7128
      if (this_present_gatewayTxnDate || that_present_gatewayTxnDate) {
7129
        if (!(this_present_gatewayTxnDate && that_present_gatewayTxnDate))
7130
          return false;
7131
        if (!this.gatewayTxnDate.equals(that.gatewayTxnDate))
7132
          return false;
7133
      }
7134
 
695 rajveer 7135
      boolean this_present_attributes = true && this.isSetAttributes();
7136
      boolean that_present_attributes = true && that.isSetAttributes();
7137
      if (this_present_attributes || that_present_attributes) {
7138
        if (!(this_present_attributes && that_present_attributes))
7139
          return false;
7140
        if (!this.attributes.equals(that.attributes))
7141
          return false;
7142
      }
7143
 
420 ashish 7144
      return true;
7145
    }
7146
 
7147
    @Override
7148
    public int hashCode() {
7149
      return 0;
7150
    }
7151
 
695 rajveer 7152
    public int compareTo(updatePaymentDetails_args other) {
420 ashish 7153
      if (!getClass().equals(other.getClass())) {
7154
        return getClass().getName().compareTo(other.getClass().getName());
7155
      }
7156
 
7157
      int lastComparison = 0;
695 rajveer 7158
      updatePaymentDetails_args typedOther = (updatePaymentDetails_args)other;
420 ashish 7159
 
7160
      lastComparison = Boolean.valueOf(isSetId()).compareTo(isSetId());
7161
      if (lastComparison != 0) {
7162
        return lastComparison;
7163
      }
7164
      lastComparison = TBaseHelper.compareTo(id, typedOther.id);
7165
      if (lastComparison != 0) {
7166
        return lastComparison;
7167
      }
695 rajveer 7168
      lastComparison = Boolean.valueOf(isSetGatewayPaymentId()).compareTo(isSetGatewayPaymentId());
420 ashish 7169
      if (lastComparison != 0) {
7170
        return lastComparison;
7171
      }
695 rajveer 7172
      lastComparison = TBaseHelper.compareTo(gatewayPaymentId, typedOther.gatewayPaymentId);
420 ashish 7173
      if (lastComparison != 0) {
7174
        return lastComparison;
7175
      }
695 rajveer 7176
      lastComparison = Boolean.valueOf(isSetSessionId()).compareTo(isSetSessionId());
420 ashish 7177
      if (lastComparison != 0) {
7178
        return lastComparison;
7179
      }
695 rajveer 7180
      lastComparison = TBaseHelper.compareTo(sessionId, typedOther.sessionId);
420 ashish 7181
      if (lastComparison != 0) {
7182
        return lastComparison;
7183
      }
695 rajveer 7184
      lastComparison = Boolean.valueOf(isSetGatewayTxnStatus()).compareTo(isSetGatewayTxnStatus());
420 ashish 7185
      if (lastComparison != 0) {
7186
        return lastComparison;
7187
      }
695 rajveer 7188
      lastComparison = TBaseHelper.compareTo(gatewayTxnStatus, typedOther.gatewayTxnStatus);
420 ashish 7189
      if (lastComparison != 0) {
7190
        return lastComparison;
7191
      }
695 rajveer 7192
      lastComparison = Boolean.valueOf(isSetDescription()).compareTo(isSetDescription());
420 ashish 7193
      if (lastComparison != 0) {
7194
        return lastComparison;
7195
      }
695 rajveer 7196
      lastComparison = TBaseHelper.compareTo(description, typedOther.description);
420 ashish 7197
      if (lastComparison != 0) {
7198
        return lastComparison;
7199
      }
695 rajveer 7200
      lastComparison = Boolean.valueOf(isSetGatewayTxnId()).compareTo(isSetGatewayTxnId());
420 ashish 7201
      if (lastComparison != 0) {
7202
        return lastComparison;
7203
      }
695 rajveer 7204
      lastComparison = TBaseHelper.compareTo(gatewayTxnId, typedOther.gatewayTxnId);
420 ashish 7205
      if (lastComparison != 0) {
7206
        return lastComparison;
7207
      }
695 rajveer 7208
      lastComparison = Boolean.valueOf(isSetAuthCode()).compareTo(isSetAuthCode());
420 ashish 7209
      if (lastComparison != 0) {
7210
        return lastComparison;
7211
      }
695 rajveer 7212
      lastComparison = TBaseHelper.compareTo(authCode, typedOther.authCode);
420 ashish 7213
      if (lastComparison != 0) {
7214
        return lastComparison;
7215
      }
695 rajveer 7216
      lastComparison = Boolean.valueOf(isSetReferenceCode()).compareTo(isSetReferenceCode());
420 ashish 7217
      if (lastComparison != 0) {
7218
        return lastComparison;
7219
      }
695 rajveer 7220
      lastComparison = TBaseHelper.compareTo(referenceCode, typedOther.referenceCode);
420 ashish 7221
      if (lastComparison != 0) {
7222
        return lastComparison;
7223
      }
695 rajveer 7224
      lastComparison = Boolean.valueOf(isSetErrorCode()).compareTo(isSetErrorCode());
7225
      if (lastComparison != 0) {
7226
        return lastComparison;
7227
      }
7228
      lastComparison = TBaseHelper.compareTo(errorCode, typedOther.errorCode);
7229
      if (lastComparison != 0) {
7230
        return lastComparison;
7231
      }
7232
      lastComparison = Boolean.valueOf(isSetStatus()).compareTo(isSetStatus());
7233
      if (lastComparison != 0) {
7234
        return lastComparison;
7235
      }
7236
      lastComparison = TBaseHelper.compareTo(status, typedOther.status);
7237
      if (lastComparison != 0) {
7238
        return lastComparison;
7239
      }
1119 rajveer 7240
      lastComparison = Boolean.valueOf(isSetGatewayTxnDate()).compareTo(isSetGatewayTxnDate());
7241
      if (lastComparison != 0) {
7242
        return lastComparison;
7243
      }
7244
      lastComparison = TBaseHelper.compareTo(gatewayTxnDate, typedOther.gatewayTxnDate);
7245
      if (lastComparison != 0) {
7246
        return lastComparison;
7247
      }
695 rajveer 7248
      lastComparison = Boolean.valueOf(isSetAttributes()).compareTo(isSetAttributes());
7249
      if (lastComparison != 0) {
7250
        return lastComparison;
7251
      }
7252
      lastComparison = TBaseHelper.compareTo(attributes, typedOther.attributes);
7253
      if (lastComparison != 0) {
7254
        return lastComparison;
7255
      }
420 ashish 7256
      return 0;
7257
    }
7258
 
7259
    public void read(TProtocol iprot) throws TException {
7260
      TField field;
7261
      iprot.readStructBegin();
7262
      while (true)
7263
      {
7264
        field = iprot.readFieldBegin();
7265
        if (field.type == TType.STOP) { 
7266
          break;
7267
        }
7268
        _Fields fieldId = _Fields.findByThriftId(field.id);
7269
        if (fieldId == null) {
7270
          TProtocolUtil.skip(iprot, field.type);
7271
        } else {
7272
          switch (fieldId) {
7273
            case ID:
7274
              if (field.type == TType.I64) {
7275
                this.id = iprot.readI64();
7276
                setIdIsSet(true);
7277
              } else { 
7278
                TProtocolUtil.skip(iprot, field.type);
7279
              }
7280
              break;
695 rajveer 7281
            case GATEWAY_PAYMENT_ID:
420 ashish 7282
              if (field.type == TType.STRING) {
695 rajveer 7283
                this.gatewayPaymentId = iprot.readString();
420 ashish 7284
              } else { 
7285
                TProtocolUtil.skip(iprot, field.type);
7286
              }
7287
              break;
695 rajveer 7288
            case SESSION_ID:
420 ashish 7289
              if (field.type == TType.STRING) {
695 rajveer 7290
                this.sessionId = iprot.readString();
420 ashish 7291
              } else { 
7292
                TProtocolUtil.skip(iprot, field.type);
7293
              }
7294
              break;
695 rajveer 7295
            case GATEWAY_TXN_STATUS:
420 ashish 7296
              if (field.type == TType.STRING) {
695 rajveer 7297
                this.gatewayTxnStatus = iprot.readString();
420 ashish 7298
              } else { 
7299
                TProtocolUtil.skip(iprot, field.type);
7300
              }
7301
              break;
695 rajveer 7302
            case DESCRIPTION:
420 ashish 7303
              if (field.type == TType.STRING) {
695 rajveer 7304
                this.description = iprot.readString();
420 ashish 7305
              } else { 
7306
                TProtocolUtil.skip(iprot, field.type);
7307
              }
7308
              break;
695 rajveer 7309
            case GATEWAY_TXN_ID:
420 ashish 7310
              if (field.type == TType.STRING) {
695 rajveer 7311
                this.gatewayTxnId = iprot.readString();
420 ashish 7312
              } else { 
7313
                TProtocolUtil.skip(iprot, field.type);
7314
              }
7315
              break;
7316
            case AUTH_CODE:
7317
              if (field.type == TType.STRING) {
695 rajveer 7318
                this.authCode = iprot.readString();
420 ashish 7319
              } else { 
7320
                TProtocolUtil.skip(iprot, field.type);
7321
              }
7322
              break;
695 rajveer 7323
            case REFERENCE_CODE:
420 ashish 7324
              if (field.type == TType.STRING) {
695 rajveer 7325
                this.referenceCode = iprot.readString();
420 ashish 7326
              } else { 
7327
                TProtocolUtil.skip(iprot, field.type);
7328
              }
7329
              break;
695 rajveer 7330
            case ERROR_CODE:
7331
              if (field.type == TType.STRING) {
7332
                this.errorCode = iprot.readString();
7333
              } else { 
7334
                TProtocolUtil.skip(iprot, field.type);
7335
              }
7336
              break;
7337
            case STATUS:
7338
              if (field.type == TType.I32) {
7339
                this.status = PaymentStatus.findByValue(iprot.readI32());
7340
              } else { 
7341
                TProtocolUtil.skip(iprot, field.type);
7342
              }
7343
              break;
1119 rajveer 7344
            case GATEWAY_TXN_DATE:
7345
              if (field.type == TType.STRING) {
7346
                this.gatewayTxnDate = iprot.readString();
7347
              } else { 
7348
                TProtocolUtil.skip(iprot, field.type);
7349
              }
7350
              break;
695 rajveer 7351
            case ATTRIBUTES:
7352
              if (field.type == TType.LIST) {
7353
                {
7354
                  TList _list20 = iprot.readListBegin();
7355
                  this.attributes = new ArrayList<Attribute>(_list20.size);
7356
                  for (int _i21 = 0; _i21 < _list20.size; ++_i21)
7357
                  {
7358
                    Attribute _elem22;
7359
                    _elem22 = new Attribute();
7360
                    _elem22.read(iprot);
7361
                    this.attributes.add(_elem22);
7362
                  }
7363
                  iprot.readListEnd();
7364
                }
7365
              } else { 
7366
                TProtocolUtil.skip(iprot, field.type);
7367
              }
7368
              break;
420 ashish 7369
          }
7370
          iprot.readFieldEnd();
7371
        }
7372
      }
7373
      iprot.readStructEnd();
7374
      validate();
7375
    }
7376
 
7377
    public void write(TProtocol oprot) throws TException {
7378
      validate();
7379
 
7380
      oprot.writeStructBegin(STRUCT_DESC);
7381
      oprot.writeFieldBegin(ID_FIELD_DESC);
7382
      oprot.writeI64(this.id);
7383
      oprot.writeFieldEnd();
695 rajveer 7384
      if (this.gatewayPaymentId != null) {
7385
        oprot.writeFieldBegin(GATEWAY_PAYMENT_ID_FIELD_DESC);
7386
        oprot.writeString(this.gatewayPaymentId);
420 ashish 7387
        oprot.writeFieldEnd();
7388
      }
695 rajveer 7389
      if (this.sessionId != null) {
7390
        oprot.writeFieldBegin(SESSION_ID_FIELD_DESC);
7391
        oprot.writeString(this.sessionId);
420 ashish 7392
        oprot.writeFieldEnd();
7393
      }
695 rajveer 7394
      if (this.gatewayTxnStatus != null) {
7395
        oprot.writeFieldBegin(GATEWAY_TXN_STATUS_FIELD_DESC);
7396
        oprot.writeString(this.gatewayTxnStatus);
420 ashish 7397
        oprot.writeFieldEnd();
7398
      }
695 rajveer 7399
      if (this.description != null) {
7400
        oprot.writeFieldBegin(DESCRIPTION_FIELD_DESC);
7401
        oprot.writeString(this.description);
420 ashish 7402
        oprot.writeFieldEnd();
7403
      }
695 rajveer 7404
      if (this.gatewayTxnId != null) {
7405
        oprot.writeFieldBegin(GATEWAY_TXN_ID_FIELD_DESC);
7406
        oprot.writeString(this.gatewayTxnId);
420 ashish 7407
        oprot.writeFieldEnd();
7408
      }
695 rajveer 7409
      if (this.authCode != null) {
420 ashish 7410
        oprot.writeFieldBegin(AUTH_CODE_FIELD_DESC);
695 rajveer 7411
        oprot.writeString(this.authCode);
420 ashish 7412
        oprot.writeFieldEnd();
7413
      }
695 rajveer 7414
      if (this.referenceCode != null) {
7415
        oprot.writeFieldBegin(REFERENCE_CODE_FIELD_DESC);
7416
        oprot.writeString(this.referenceCode);
420 ashish 7417
        oprot.writeFieldEnd();
7418
      }
695 rajveer 7419
      if (this.errorCode != null) {
7420
        oprot.writeFieldBegin(ERROR_CODE_FIELD_DESC);
7421
        oprot.writeString(this.errorCode);
7422
        oprot.writeFieldEnd();
7423
      }
7424
      if (this.status != null) {
7425
        oprot.writeFieldBegin(STATUS_FIELD_DESC);
7426
        oprot.writeI32(this.status.getValue());
7427
        oprot.writeFieldEnd();
7428
      }
1119 rajveer 7429
      if (this.gatewayTxnDate != null) {
7430
        oprot.writeFieldBegin(GATEWAY_TXN_DATE_FIELD_DESC);
7431
        oprot.writeString(this.gatewayTxnDate);
7432
        oprot.writeFieldEnd();
7433
      }
695 rajveer 7434
      if (this.attributes != null) {
7435
        oprot.writeFieldBegin(ATTRIBUTES_FIELD_DESC);
7436
        {
7437
          oprot.writeListBegin(new TList(TType.STRUCT, this.attributes.size()));
7438
          for (Attribute _iter23 : this.attributes)
7439
          {
7440
            _iter23.write(oprot);
7441
          }
7442
          oprot.writeListEnd();
7443
        }
7444
        oprot.writeFieldEnd();
7445
      }
420 ashish 7446
      oprot.writeFieldStop();
7447
      oprot.writeStructEnd();
7448
    }
7449
 
7450
    @Override
7451
    public String toString() {
695 rajveer 7452
      StringBuilder sb = new StringBuilder("updatePaymentDetails_args(");
420 ashish 7453
      boolean first = true;
7454
 
7455
      sb.append("id:");
7456
      sb.append(this.id);
7457
      first = false;
7458
      if (!first) sb.append(", ");
695 rajveer 7459
      sb.append("gatewayPaymentId:");
7460
      if (this.gatewayPaymentId == null) {
420 ashish 7461
        sb.append("null");
7462
      } else {
695 rajveer 7463
        sb.append(this.gatewayPaymentId);
420 ashish 7464
      }
7465
      first = false;
7466
      if (!first) sb.append(", ");
695 rajveer 7467
      sb.append("sessionId:");
7468
      if (this.sessionId == null) {
420 ashish 7469
        sb.append("null");
7470
      } else {
695 rajveer 7471
        sb.append(this.sessionId);
420 ashish 7472
      }
7473
      first = false;
7474
      if (!first) sb.append(", ");
695 rajveer 7475
      sb.append("gatewayTxnStatus:");
7476
      if (this.gatewayTxnStatus == null) {
420 ashish 7477
        sb.append("null");
7478
      } else {
695 rajveer 7479
        sb.append(this.gatewayTxnStatus);
420 ashish 7480
      }
7481
      first = false;
7482
      if (!first) sb.append(", ");
695 rajveer 7483
      sb.append("description:");
7484
      if (this.description == null) {
420 ashish 7485
        sb.append("null");
7486
      } else {
695 rajveer 7487
        sb.append(this.description);
420 ashish 7488
      }
7489
      first = false;
7490
      if (!first) sb.append(", ");
695 rajveer 7491
      sb.append("gatewayTxnId:");
7492
      if (this.gatewayTxnId == null) {
420 ashish 7493
        sb.append("null");
7494
      } else {
695 rajveer 7495
        sb.append(this.gatewayTxnId);
420 ashish 7496
      }
7497
      first = false;
7498
      if (!first) sb.append(", ");
695 rajveer 7499
      sb.append("authCode:");
7500
      if (this.authCode == null) {
420 ashish 7501
        sb.append("null");
7502
      } else {
695 rajveer 7503
        sb.append(this.authCode);
420 ashish 7504
      }
7505
      first = false;
7506
      if (!first) sb.append(", ");
695 rajveer 7507
      sb.append("referenceCode:");
7508
      if (this.referenceCode == null) {
420 ashish 7509
        sb.append("null");
7510
      } else {
695 rajveer 7511
        sb.append(this.referenceCode);
420 ashish 7512
      }
7513
      first = false;
695 rajveer 7514
      if (!first) sb.append(", ");
7515
      sb.append("errorCode:");
7516
      if (this.errorCode == null) {
7517
        sb.append("null");
7518
      } else {
7519
        sb.append(this.errorCode);
7520
      }
7521
      first = false;
7522
      if (!first) sb.append(", ");
7523
      sb.append("status:");
7524
      if (this.status == null) {
7525
        sb.append("null");
7526
      } else {
7527
        String status_name = status.name();
7528
        if (status_name != null) {
7529
          sb.append(status_name);
7530
          sb.append(" (");
7531
        }
7532
        sb.append(this.status);
7533
        if (status_name != null) {
7534
          sb.append(")");
7535
        }
7536
      }
7537
      first = false;
7538
      if (!first) sb.append(", ");
1119 rajveer 7539
      sb.append("gatewayTxnDate:");
7540
      if (this.gatewayTxnDate == null) {
7541
        sb.append("null");
7542
      } else {
7543
        sb.append(this.gatewayTxnDate);
7544
      }
7545
      first = false;
7546
      if (!first) sb.append(", ");
695 rajveer 7547
      sb.append("attributes:");
7548
      if (this.attributes == null) {
7549
        sb.append("null");
7550
      } else {
7551
        sb.append(this.attributes);
7552
      }
7553
      first = false;
420 ashish 7554
      sb.append(")");
7555
      return sb.toString();
7556
    }
7557
 
7558
    public void validate() throws TException {
7559
      // check for required fields
7560
    }
7561
 
7562
  }
7563
 
695 rajveer 7564
  public static class updatePaymentDetails_result implements TBase<updatePaymentDetails_result._Fields>, java.io.Serializable, Cloneable, Comparable<updatePaymentDetails_result>   {
7565
    private static final TStruct STRUCT_DESC = new TStruct("updatePaymentDetails_result");
420 ashish 7566
 
695 rajveer 7567
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0);
420 ashish 7568
    private static final TField PE_FIELD_DESC = new TField("pe", TType.STRUCT, (short)1);
7569
 
695 rajveer 7570
    private boolean success;
420 ashish 7571
    private PaymentException pe;
7572
 
7573
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
7574
    public enum _Fields implements TFieldIdEnum {
695 rajveer 7575
      SUCCESS((short)0, "success"),
420 ashish 7576
      PE((short)1, "pe");
7577
 
7578
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
7579
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7580
 
7581
      static {
7582
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7583
          byId.put((int)field._thriftId, field);
7584
          byName.put(field.getFieldName(), field);
7585
        }
7586
      }
7587
 
7588
      /**
7589
       * Find the _Fields constant that matches fieldId, or null if its not found.
7590
       */
7591
      public static _Fields findByThriftId(int fieldId) {
7592
        return byId.get(fieldId);
7593
      }
7594
 
7595
      /**
7596
       * Find the _Fields constant that matches fieldId, throwing an exception
7597
       * if it is not found.
7598
       */
7599
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7600
        _Fields fields = findByThriftId(fieldId);
7601
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7602
        return fields;
7603
      }
7604
 
7605
      /**
7606
       * Find the _Fields constant that matches name, or null if its not found.
7607
       */
7608
      public static _Fields findByName(String name) {
7609
        return byName.get(name);
7610
      }
7611
 
7612
      private final short _thriftId;
7613
      private final String _fieldName;
7614
 
7615
      _Fields(short thriftId, String fieldName) {
7616
        _thriftId = thriftId;
7617
        _fieldName = fieldName;
7618
      }
7619
 
7620
      public short getThriftFieldId() {
7621
        return _thriftId;
7622
      }
7623
 
7624
      public String getFieldName() {
7625
        return _fieldName;
7626
      }
7627
    }
7628
 
7629
    // isset id assignments
695 rajveer 7630
    private static final int __SUCCESS_ISSET_ID = 0;
7631
    private BitSet __isset_bit_vector = new BitSet(1);
420 ashish 7632
 
7633
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
695 rajveer 7634
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
7635
          new FieldValueMetaData(TType.BOOL)));
420 ashish 7636
      put(_Fields.PE, new FieldMetaData("pe", TFieldRequirementType.DEFAULT, 
7637
          new FieldValueMetaData(TType.STRUCT)));
7638
    }});
7639
 
7640
    static {
695 rajveer 7641
      FieldMetaData.addStructMetaDataMap(updatePaymentDetails_result.class, metaDataMap);
420 ashish 7642
    }
7643
 
695 rajveer 7644
    public updatePaymentDetails_result() {
420 ashish 7645
    }
7646
 
695 rajveer 7647
    public updatePaymentDetails_result(
7648
      boolean success,
420 ashish 7649
      PaymentException pe)
7650
    {
7651
      this();
695 rajveer 7652
      this.success = success;
7653
      setSuccessIsSet(true);
420 ashish 7654
      this.pe = pe;
7655
    }
7656
 
7657
    /**
7658
     * Performs a deep copy on <i>other</i>.
7659
     */
695 rajveer 7660
    public updatePaymentDetails_result(updatePaymentDetails_result other) {
7661
      __isset_bit_vector.clear();
7662
      __isset_bit_vector.or(other.__isset_bit_vector);
7663
      this.success = other.success;
420 ashish 7664
      if (other.isSetPe()) {
7665
        this.pe = new PaymentException(other.pe);
7666
      }
7667
    }
7668
 
695 rajveer 7669
    public updatePaymentDetails_result deepCopy() {
7670
      return new updatePaymentDetails_result(this);
420 ashish 7671
    }
7672
 
7673
    @Deprecated
695 rajveer 7674
    public updatePaymentDetails_result clone() {
7675
      return new updatePaymentDetails_result(this);
420 ashish 7676
    }
7677
 
695 rajveer 7678
    public boolean isSuccess() {
7679
      return this.success;
7680
    }
7681
 
7682
    public updatePaymentDetails_result setSuccess(boolean success) {
7683
      this.success = success;
7684
      setSuccessIsSet(true);
7685
      return this;
7686
    }
7687
 
7688
    public void unsetSuccess() {
7689
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
7690
    }
7691
 
7692
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
7693
    public boolean isSetSuccess() {
7694
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
7695
    }
7696
 
7697
    public void setSuccessIsSet(boolean value) {
7698
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
7699
    }
7700
 
420 ashish 7701
    public PaymentException getPe() {
7702
      return this.pe;
7703
    }
7704
 
695 rajveer 7705
    public updatePaymentDetails_result setPe(PaymentException pe) {
420 ashish 7706
      this.pe = pe;
7707
      return this;
7708
    }
7709
 
7710
    public void unsetPe() {
7711
      this.pe = null;
7712
    }
7713
 
7714
    /** Returns true if field pe is set (has been asigned a value) and false otherwise */
7715
    public boolean isSetPe() {
7716
      return this.pe != null;
7717
    }
7718
 
7719
    public void setPeIsSet(boolean value) {
7720
      if (!value) {
7721
        this.pe = null;
7722
      }
7723
    }
7724
 
7725
    public void setFieldValue(_Fields field, Object value) {
7726
      switch (field) {
695 rajveer 7727
      case SUCCESS:
7728
        if (value == null) {
7729
          unsetSuccess();
7730
        } else {
7731
          setSuccess((Boolean)value);
7732
        }
7733
        break;
7734
 
420 ashish 7735
      case PE:
7736
        if (value == null) {
7737
          unsetPe();
7738
        } else {
7739
          setPe((PaymentException)value);
7740
        }
7741
        break;
7742
 
7743
      }
7744
    }
7745
 
7746
    public void setFieldValue(int fieldID, Object value) {
7747
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
7748
    }
7749
 
7750
    public Object getFieldValue(_Fields field) {
7751
      switch (field) {
695 rajveer 7752
      case SUCCESS:
7753
        return new Boolean(isSuccess());
7754
 
420 ashish 7755
      case PE:
7756
        return getPe();
7757
 
7758
      }
7759
      throw new IllegalStateException();
7760
    }
7761
 
7762
    public Object getFieldValue(int fieldId) {
7763
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
7764
    }
7765
 
7766
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
7767
    public boolean isSet(_Fields field) {
7768
      switch (field) {
695 rajveer 7769
      case SUCCESS:
7770
        return isSetSuccess();
420 ashish 7771
      case PE:
7772
        return isSetPe();
7773
      }
7774
      throw new IllegalStateException();
7775
    }
7776
 
7777
    public boolean isSet(int fieldID) {
7778
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
7779
    }
7780
 
7781
    @Override
7782
    public boolean equals(Object that) {
7783
      if (that == null)
7784
        return false;
695 rajveer 7785
      if (that instanceof updatePaymentDetails_result)
7786
        return this.equals((updatePaymentDetails_result)that);
420 ashish 7787
      return false;
7788
    }
7789
 
695 rajveer 7790
    public boolean equals(updatePaymentDetails_result that) {
420 ashish 7791
      if (that == null)
7792
        return false;
7793
 
695 rajveer 7794
      boolean this_present_success = true;
7795
      boolean that_present_success = true;
7796
      if (this_present_success || that_present_success) {
7797
        if (!(this_present_success && that_present_success))
7798
          return false;
7799
        if (this.success != that.success)
7800
          return false;
7801
      }
7802
 
420 ashish 7803
      boolean this_present_pe = true && this.isSetPe();
7804
      boolean that_present_pe = true && that.isSetPe();
7805
      if (this_present_pe || that_present_pe) {
7806
        if (!(this_present_pe && that_present_pe))
7807
          return false;
7808
        if (!this.pe.equals(that.pe))
7809
          return false;
7810
      }
7811
 
7812
      return true;
7813
    }
7814
 
7815
    @Override
7816
    public int hashCode() {
7817
      return 0;
7818
    }
7819
 
695 rajveer 7820
    public int compareTo(updatePaymentDetails_result other) {
420 ashish 7821
      if (!getClass().equals(other.getClass())) {
7822
        return getClass().getName().compareTo(other.getClass().getName());
7823
      }
7824
 
7825
      int lastComparison = 0;
695 rajveer 7826
      updatePaymentDetails_result typedOther = (updatePaymentDetails_result)other;
420 ashish 7827
 
695 rajveer 7828
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
7829
      if (lastComparison != 0) {
7830
        return lastComparison;
7831
      }
7832
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
7833
      if (lastComparison != 0) {
7834
        return lastComparison;
7835
      }
420 ashish 7836
      lastComparison = Boolean.valueOf(isSetPe()).compareTo(isSetPe());
7837
      if (lastComparison != 0) {
7838
        return lastComparison;
7839
      }
7840
      lastComparison = TBaseHelper.compareTo(pe, typedOther.pe);
7841
      if (lastComparison != 0) {
7842
        return lastComparison;
7843
      }
7844
      return 0;
7845
    }
7846
 
7847
    public void read(TProtocol iprot) throws TException {
7848
      TField field;
7849
      iprot.readStructBegin();
7850
      while (true)
7851
      {
7852
        field = iprot.readFieldBegin();
7853
        if (field.type == TType.STOP) { 
7854
          break;
7855
        }
7856
        _Fields fieldId = _Fields.findByThriftId(field.id);
7857
        if (fieldId == null) {
7858
          TProtocolUtil.skip(iprot, field.type);
7859
        } else {
7860
          switch (fieldId) {
695 rajveer 7861
            case SUCCESS:
7862
              if (field.type == TType.BOOL) {
7863
                this.success = iprot.readBool();
7864
                setSuccessIsSet(true);
7865
              } else { 
7866
                TProtocolUtil.skip(iprot, field.type);
7867
              }
7868
              break;
420 ashish 7869
            case PE:
7870
              if (field.type == TType.STRUCT) {
7871
                this.pe = new PaymentException();
7872
                this.pe.read(iprot);
7873
              } else { 
7874
                TProtocolUtil.skip(iprot, field.type);
7875
              }
7876
              break;
7877
          }
7878
          iprot.readFieldEnd();
7879
        }
7880
      }
7881
      iprot.readStructEnd();
7882
      validate();
7883
    }
7884
 
7885
    public void write(TProtocol oprot) throws TException {
7886
      oprot.writeStructBegin(STRUCT_DESC);
7887
 
695 rajveer 7888
      if (this.isSetSuccess()) {
7889
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
7890
        oprot.writeBool(this.success);
7891
        oprot.writeFieldEnd();
7892
      } else if (this.isSetPe()) {
420 ashish 7893
        oprot.writeFieldBegin(PE_FIELD_DESC);
7894
        this.pe.write(oprot);
7895
        oprot.writeFieldEnd();
7896
      }
7897
      oprot.writeFieldStop();
7898
      oprot.writeStructEnd();
7899
    }
7900
 
7901
    @Override
7902
    public String toString() {
695 rajveer 7903
      StringBuilder sb = new StringBuilder("updatePaymentDetails_result(");
420 ashish 7904
      boolean first = true;
7905
 
695 rajveer 7906
      sb.append("success:");
7907
      sb.append(this.success);
7908
      first = false;
7909
      if (!first) sb.append(", ");
420 ashish 7910
      sb.append("pe:");
7911
      if (this.pe == null) {
7912
        sb.append("null");
7913
      } else {
7914
        sb.append(this.pe);
7915
      }
7916
      first = false;
7917
      sb.append(")");
7918
      return sb.toString();
7919
    }
7920
 
7921
    public void validate() throws TException {
7922
      // check for required fields
7923
    }
7924
 
7925
  }
7926
 
1731 ankur.sing 7927
  public static class getSuccessfulPaymentsAmountRange_args implements TBase<getSuccessfulPaymentsAmountRange_args._Fields>, java.io.Serializable, Cloneable, Comparable<getSuccessfulPaymentsAmountRange_args>   {
7928
    private static final TStruct STRUCT_DESC = new TStruct("getSuccessfulPaymentsAmountRange_args");
1629 ankur.sing 7929
 
7930
 
7931
 
7932
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
7933
    public enum _Fields implements TFieldIdEnum {
7934
;
7935
 
7936
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
7937
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7938
 
7939
      static {
7940
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7941
          byId.put((int)field._thriftId, field);
7942
          byName.put(field.getFieldName(), field);
7943
        }
7944
      }
7945
 
7946
      /**
7947
       * Find the _Fields constant that matches fieldId, or null if its not found.
7948
       */
7949
      public static _Fields findByThriftId(int fieldId) {
7950
        return byId.get(fieldId);
7951
      }
7952
 
7953
      /**
7954
       * Find the _Fields constant that matches fieldId, throwing an exception
7955
       * if it is not found.
7956
       */
7957
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7958
        _Fields fields = findByThriftId(fieldId);
7959
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7960
        return fields;
7961
      }
7962
 
7963
      /**
7964
       * Find the _Fields constant that matches name, or null if its not found.
7965
       */
7966
      public static _Fields findByName(String name) {
7967
        return byName.get(name);
7968
      }
7969
 
7970
      private final short _thriftId;
7971
      private final String _fieldName;
7972
 
7973
      _Fields(short thriftId, String fieldName) {
7974
        _thriftId = thriftId;
7975
        _fieldName = fieldName;
7976
      }
7977
 
7978
      public short getThriftFieldId() {
7979
        return _thriftId;
7980
      }
7981
 
7982
      public String getFieldName() {
7983
        return _fieldName;
7984
      }
7985
    }
7986
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
7987
    }});
7988
 
7989
    static {
1731 ankur.sing 7990
      FieldMetaData.addStructMetaDataMap(getSuccessfulPaymentsAmountRange_args.class, metaDataMap);
1629 ankur.sing 7991
    }
7992
 
1731 ankur.sing 7993
    public getSuccessfulPaymentsAmountRange_args() {
1629 ankur.sing 7994
    }
7995
 
7996
    /**
7997
     * Performs a deep copy on <i>other</i>.
7998
     */
1731 ankur.sing 7999
    public getSuccessfulPaymentsAmountRange_args(getSuccessfulPaymentsAmountRange_args other) {
1629 ankur.sing 8000
    }
8001
 
1731 ankur.sing 8002
    public getSuccessfulPaymentsAmountRange_args deepCopy() {
8003
      return new getSuccessfulPaymentsAmountRange_args(this);
1629 ankur.sing 8004
    }
8005
 
8006
    @Deprecated
1731 ankur.sing 8007
    public getSuccessfulPaymentsAmountRange_args clone() {
8008
      return new getSuccessfulPaymentsAmountRange_args(this);
1629 ankur.sing 8009
    }
8010
 
8011
    public void setFieldValue(_Fields field, Object value) {
8012
      switch (field) {
8013
      }
8014
    }
8015
 
8016
    public void setFieldValue(int fieldID, Object value) {
8017
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
8018
    }
8019
 
8020
    public Object getFieldValue(_Fields field) {
8021
      switch (field) {
8022
      }
8023
      throw new IllegalStateException();
8024
    }
8025
 
8026
    public Object getFieldValue(int fieldId) {
8027
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
8028
    }
8029
 
8030
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
8031
    public boolean isSet(_Fields field) {
8032
      switch (field) {
8033
      }
8034
      throw new IllegalStateException();
8035
    }
8036
 
8037
    public boolean isSet(int fieldID) {
8038
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
8039
    }
8040
 
8041
    @Override
8042
    public boolean equals(Object that) {
8043
      if (that == null)
8044
        return false;
1731 ankur.sing 8045
      if (that instanceof getSuccessfulPaymentsAmountRange_args)
8046
        return this.equals((getSuccessfulPaymentsAmountRange_args)that);
1629 ankur.sing 8047
      return false;
8048
    }
8049
 
1731 ankur.sing 8050
    public boolean equals(getSuccessfulPaymentsAmountRange_args that) {
1629 ankur.sing 8051
      if (that == null)
8052
        return false;
8053
 
8054
      return true;
8055
    }
8056
 
8057
    @Override
8058
    public int hashCode() {
8059
      return 0;
8060
    }
8061
 
1731 ankur.sing 8062
    public int compareTo(getSuccessfulPaymentsAmountRange_args other) {
1629 ankur.sing 8063
      if (!getClass().equals(other.getClass())) {
8064
        return getClass().getName().compareTo(other.getClass().getName());
8065
      }
8066
 
8067
      int lastComparison = 0;
1731 ankur.sing 8068
      getSuccessfulPaymentsAmountRange_args typedOther = (getSuccessfulPaymentsAmountRange_args)other;
1629 ankur.sing 8069
 
8070
      return 0;
8071
    }
8072
 
8073
    public void read(TProtocol iprot) throws TException {
8074
      TField field;
8075
      iprot.readStructBegin();
8076
      while (true)
8077
      {
8078
        field = iprot.readFieldBegin();
8079
        if (field.type == TType.STOP) { 
8080
          break;
8081
        }
8082
        _Fields fieldId = _Fields.findByThriftId(field.id);
8083
        if (fieldId == null) {
8084
          TProtocolUtil.skip(iprot, field.type);
8085
        } else {
8086
          switch (fieldId) {
8087
          }
8088
          iprot.readFieldEnd();
8089
        }
8090
      }
8091
      iprot.readStructEnd();
8092
      validate();
8093
    }
8094
 
8095
    public void write(TProtocol oprot) throws TException {
8096
      validate();
8097
 
8098
      oprot.writeStructBegin(STRUCT_DESC);
8099
      oprot.writeFieldStop();
8100
      oprot.writeStructEnd();
8101
    }
8102
 
8103
    @Override
8104
    public String toString() {
1731 ankur.sing 8105
      StringBuilder sb = new StringBuilder("getSuccessfulPaymentsAmountRange_args(");
1629 ankur.sing 8106
      boolean first = true;
8107
 
8108
      sb.append(")");
8109
      return sb.toString();
8110
    }
8111
 
8112
    public void validate() throws TException {
8113
      // check for required fields
8114
    }
8115
 
8116
  }
8117
 
1731 ankur.sing 8118
  public static class getSuccessfulPaymentsAmountRange_result implements TBase<getSuccessfulPaymentsAmountRange_result._Fields>, java.io.Serializable, Cloneable, Comparable<getSuccessfulPaymentsAmountRange_result>   {
8119
    private static final TStruct STRUCT_DESC = new TStruct("getSuccessfulPaymentsAmountRange_result");
1629 ankur.sing 8120
 
1731 ankur.sing 8121
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0);
1629 ankur.sing 8122
 
1731 ankur.sing 8123
    private List<Double> success;
1629 ankur.sing 8124
 
8125
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
8126
    public enum _Fields implements TFieldIdEnum {
8127
      SUCCESS((short)0, "success");
8128
 
8129
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
8130
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8131
 
8132
      static {
8133
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8134
          byId.put((int)field._thriftId, field);
8135
          byName.put(field.getFieldName(), field);
8136
        }
8137
      }
8138
 
8139
      /**
8140
       * Find the _Fields constant that matches fieldId, or null if its not found.
8141
       */
8142
      public static _Fields findByThriftId(int fieldId) {
8143
        return byId.get(fieldId);
8144
      }
8145
 
8146
      /**
8147
       * Find the _Fields constant that matches fieldId, throwing an exception
8148
       * if it is not found.
8149
       */
8150
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8151
        _Fields fields = findByThriftId(fieldId);
8152
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8153
        return fields;
8154
      }
8155
 
8156
      /**
8157
       * Find the _Fields constant that matches name, or null if its not found.
8158
       */
8159
      public static _Fields findByName(String name) {
8160
        return byName.get(name);
8161
      }
8162
 
8163
      private final short _thriftId;
8164
      private final String _fieldName;
8165
 
8166
      _Fields(short thriftId, String fieldName) {
8167
        _thriftId = thriftId;
8168
        _fieldName = fieldName;
8169
      }
8170
 
8171
      public short getThriftFieldId() {
8172
        return _thriftId;
8173
      }
8174
 
8175
      public String getFieldName() {
8176
        return _fieldName;
8177
      }
8178
    }
8179
 
8180
    // isset id assignments
8181
 
8182
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
8183
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
1731 ankur.sing 8184
          new ListMetaData(TType.LIST, 
8185
              new FieldValueMetaData(TType.DOUBLE))));
1629 ankur.sing 8186
    }});
8187
 
8188
    static {
1731 ankur.sing 8189
      FieldMetaData.addStructMetaDataMap(getSuccessfulPaymentsAmountRange_result.class, metaDataMap);
1629 ankur.sing 8190
    }
8191
 
1731 ankur.sing 8192
    public getSuccessfulPaymentsAmountRange_result() {
1629 ankur.sing 8193
    }
8194
 
1731 ankur.sing 8195
    public getSuccessfulPaymentsAmountRange_result(
8196
      List<Double> success)
1629 ankur.sing 8197
    {
8198
      this();
8199
      this.success = success;
8200
    }
8201
 
8202
    /**
8203
     * Performs a deep copy on <i>other</i>.
8204
     */
1731 ankur.sing 8205
    public getSuccessfulPaymentsAmountRange_result(getSuccessfulPaymentsAmountRange_result other) {
8206
      if (other.isSetSuccess()) {
8207
        List<Double> __this__success = new ArrayList<Double>();
8208
        for (Double other_element : other.success) {
8209
          __this__success.add(other_element);
1629 ankur.sing 8210
        }
1731 ankur.sing 8211
        this.success = __this__success;
1629 ankur.sing 8212
      }
8213
    }
8214
 
1731 ankur.sing 8215
    public getSuccessfulPaymentsAmountRange_result deepCopy() {
8216
      return new getSuccessfulPaymentsAmountRange_result(this);
1629 ankur.sing 8217
    }
8218
 
8219
    @Deprecated
1731 ankur.sing 8220
    public getSuccessfulPaymentsAmountRange_result clone() {
8221
      return new getSuccessfulPaymentsAmountRange_result(this);
1629 ankur.sing 8222
    }
8223
 
1731 ankur.sing 8224
    public int getSuccessSize() {
8225
      return (this.success == null) ? 0 : this.success.size();
1629 ankur.sing 8226
    }
8227
 
1731 ankur.sing 8228
    public java.util.Iterator<Double> getSuccessIterator() {
8229
      return (this.success == null) ? null : this.success.iterator();
1629 ankur.sing 8230
    }
8231
 
1731 ankur.sing 8232
    public void addToSuccess(double elem) {
8233
      if (this.success == null) {
8234
        this.success = new ArrayList<Double>();
1629 ankur.sing 8235
      }
1731 ankur.sing 8236
      this.success.add(elem);
1629 ankur.sing 8237
    }
8238
 
1731 ankur.sing 8239
    public List<Double> getSuccess() {
1629 ankur.sing 8240
      return this.success;
8241
    }
8242
 
1731 ankur.sing 8243
    public getSuccessfulPaymentsAmountRange_result setSuccess(List<Double> success) {
1629 ankur.sing 8244
      this.success = success;
8245
      return this;
8246
    }
8247
 
8248
    public void unsetSuccess() {
1731 ankur.sing 8249
      this.success = null;
1629 ankur.sing 8250
    }
8251
 
8252
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
8253
    public boolean isSetSuccess() {
1731 ankur.sing 8254
      return this.success != null;
1629 ankur.sing 8255
    }
8256
 
8257
    public void setSuccessIsSet(boolean value) {
1731 ankur.sing 8258
      if (!value) {
8259
        this.success = null;
8260
      }
1629 ankur.sing 8261
    }
8262
 
8263
    public void setFieldValue(_Fields field, Object value) {
8264
      switch (field) {
8265
      case SUCCESS:
8266
        if (value == null) {
8267
          unsetSuccess();
8268
        } else {
1731 ankur.sing 8269
          setSuccess((List<Double>)value);
1629 ankur.sing 8270
        }
8271
        break;
8272
 
8273
      }
8274
    }
8275
 
8276
    public void setFieldValue(int fieldID, Object value) {
8277
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
8278
    }
8279
 
8280
    public Object getFieldValue(_Fields field) {
8281
      switch (field) {
8282
      case SUCCESS:
1731 ankur.sing 8283
        return getSuccess();
1629 ankur.sing 8284
 
8285
      }
8286
      throw new IllegalStateException();
8287
    }
8288
 
8289
    public Object getFieldValue(int fieldId) {
8290
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
8291
    }
8292
 
8293
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
8294
    public boolean isSet(_Fields field) {
8295
      switch (field) {
8296
      case SUCCESS:
8297
        return isSetSuccess();
8298
      }
8299
      throw new IllegalStateException();
8300
    }
8301
 
8302
    public boolean isSet(int fieldID) {
8303
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
8304
    }
8305
 
8306
    @Override
8307
    public boolean equals(Object that) {
8308
      if (that == null)
8309
        return false;
1731 ankur.sing 8310
      if (that instanceof getSuccessfulPaymentsAmountRange_result)
8311
        return this.equals((getSuccessfulPaymentsAmountRange_result)that);
1629 ankur.sing 8312
      return false;
8313
    }
8314
 
1731 ankur.sing 8315
    public boolean equals(getSuccessfulPaymentsAmountRange_result that) {
1629 ankur.sing 8316
      if (that == null)
8317
        return false;
8318
 
1731 ankur.sing 8319
      boolean this_present_success = true && this.isSetSuccess();
8320
      boolean that_present_success = true && that.isSetSuccess();
1629 ankur.sing 8321
      if (this_present_success || that_present_success) {
8322
        if (!(this_present_success && that_present_success))
8323
          return false;
1731 ankur.sing 8324
        if (!this.success.equals(that.success))
1629 ankur.sing 8325
          return false;
8326
      }
8327
 
8328
      return true;
8329
    }
8330
 
8331
    @Override
8332
    public int hashCode() {
8333
      return 0;
8334
    }
8335
 
1731 ankur.sing 8336
    public int compareTo(getSuccessfulPaymentsAmountRange_result other) {
1629 ankur.sing 8337
      if (!getClass().equals(other.getClass())) {
8338
        return getClass().getName().compareTo(other.getClass().getName());
8339
      }
8340
 
8341
      int lastComparison = 0;
1731 ankur.sing 8342
      getSuccessfulPaymentsAmountRange_result typedOther = (getSuccessfulPaymentsAmountRange_result)other;
1629 ankur.sing 8343
 
8344
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
8345
      if (lastComparison != 0) {
8346
        return lastComparison;
8347
      }
8348
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
8349
      if (lastComparison != 0) {
8350
        return lastComparison;
8351
      }
8352
      return 0;
8353
    }
8354
 
8355
    public void read(TProtocol iprot) throws TException {
8356
      TField field;
8357
      iprot.readStructBegin();
8358
      while (true)
8359
      {
8360
        field = iprot.readFieldBegin();
8361
        if (field.type == TType.STOP) { 
8362
          break;
8363
        }
8364
        _Fields fieldId = _Fields.findByThriftId(field.id);
8365
        if (fieldId == null) {
8366
          TProtocolUtil.skip(iprot, field.type);
8367
        } else {
8368
          switch (fieldId) {
8369
            case SUCCESS:
1731 ankur.sing 8370
              if (field.type == TType.LIST) {
8371
                {
8372
                  TList _list24 = iprot.readListBegin();
8373
                  this.success = new ArrayList<Double>(_list24.size);
8374
                  for (int _i25 = 0; _i25 < _list24.size; ++_i25)
8375
                  {
8376
                    double _elem26;
8377
                    _elem26 = iprot.readDouble();
8378
                    this.success.add(_elem26);
8379
                  }
8380
                  iprot.readListEnd();
8381
                }
1629 ankur.sing 8382
              } else { 
8383
                TProtocolUtil.skip(iprot, field.type);
8384
              }
8385
              break;
8386
          }
8387
          iprot.readFieldEnd();
8388
        }
8389
      }
8390
      iprot.readStructEnd();
8391
      validate();
8392
    }
8393
 
8394
    public void write(TProtocol oprot) throws TException {
8395
      oprot.writeStructBegin(STRUCT_DESC);
8396
 
8397
      if (this.isSetSuccess()) {
8398
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
1731 ankur.sing 8399
        {
8400
          oprot.writeListBegin(new TList(TType.DOUBLE, this.success.size()));
8401
          for (double _iter27 : this.success)
8402
          {
8403
            oprot.writeDouble(_iter27);
8404
          }
8405
          oprot.writeListEnd();
8406
        }
1629 ankur.sing 8407
        oprot.writeFieldEnd();
8408
      }
8409
      oprot.writeFieldStop();
8410
      oprot.writeStructEnd();
8411
    }
8412
 
8413
    @Override
8414
    public String toString() {
1731 ankur.sing 8415
      StringBuilder sb = new StringBuilder("getSuccessfulPaymentsAmountRange_result(");
1629 ankur.sing 8416
      boolean first = true;
8417
 
8418
      sb.append("success:");
1731 ankur.sing 8419
      if (this.success == null) {
8420
        sb.append("null");
8421
      } else {
8422
        sb.append(this.success);
8423
      }
1629 ankur.sing 8424
      first = false;
8425
      sb.append(")");
8426
      return sb.toString();
8427
    }
8428
 
8429
    public void validate() throws TException {
8430
      // check for required fields
8431
    }
8432
 
8433
  }
8434
 
2462 chandransh 8435
  public static class updateAndCaptureEbsPayment_args implements TBase<updateAndCaptureEbsPayment_args._Fields>, java.io.Serializable, Cloneable   {
8436
    private static final TStruct STRUCT_DESC = new TStruct("updateAndCaptureEbsPayment_args");
8437
 
8438
    private static final TField PAYMENT_PARAMS_FIELD_DESC = new TField("paymentParams", TType.MAP, (short)1);
8439
 
8440
    private Map<String,String> paymentParams;
8441
 
8442
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
8443
    public enum _Fields implements TFieldIdEnum {
8444
      PAYMENT_PARAMS((short)1, "paymentParams");
8445
 
8446
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
8447
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8448
 
8449
      static {
8450
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8451
          byId.put((int)field._thriftId, field);
8452
          byName.put(field.getFieldName(), field);
8453
        }
8454
      }
8455
 
8456
      /**
8457
       * Find the _Fields constant that matches fieldId, or null if its not found.
8458
       */
8459
      public static _Fields findByThriftId(int fieldId) {
8460
        return byId.get(fieldId);
8461
      }
8462
 
8463
      /**
8464
       * Find the _Fields constant that matches fieldId, throwing an exception
8465
       * if it is not found.
8466
       */
8467
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8468
        _Fields fields = findByThriftId(fieldId);
8469
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8470
        return fields;
8471
      }
8472
 
8473
      /**
8474
       * Find the _Fields constant that matches name, or null if its not found.
8475
       */
8476
      public static _Fields findByName(String name) {
8477
        return byName.get(name);
8478
      }
8479
 
8480
      private final short _thriftId;
8481
      private final String _fieldName;
8482
 
8483
      _Fields(short thriftId, String fieldName) {
8484
        _thriftId = thriftId;
8485
        _fieldName = fieldName;
8486
      }
8487
 
8488
      public short getThriftFieldId() {
8489
        return _thriftId;
8490
      }
8491
 
8492
      public String getFieldName() {
8493
        return _fieldName;
8494
      }
8495
    }
8496
 
8497
    // isset id assignments
8498
 
8499
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
8500
      put(_Fields.PAYMENT_PARAMS, new FieldMetaData("paymentParams", TFieldRequirementType.DEFAULT, 
8501
          new MapMetaData(TType.MAP, 
8502
              new FieldValueMetaData(TType.STRING), 
8503
              new FieldValueMetaData(TType.STRING))));
8504
    }});
8505
 
8506
    static {
8507
      FieldMetaData.addStructMetaDataMap(updateAndCaptureEbsPayment_args.class, metaDataMap);
8508
    }
8509
 
8510
    public updateAndCaptureEbsPayment_args() {
8511
    }
8512
 
8513
    public updateAndCaptureEbsPayment_args(
8514
      Map<String,String> paymentParams)
8515
    {
8516
      this();
8517
      this.paymentParams = paymentParams;
8518
    }
8519
 
8520
    /**
8521
     * Performs a deep copy on <i>other</i>.
8522
     */
8523
    public updateAndCaptureEbsPayment_args(updateAndCaptureEbsPayment_args other) {
8524
      if (other.isSetPaymentParams()) {
8525
        Map<String,String> __this__paymentParams = new HashMap<String,String>();
8526
        for (Map.Entry<String, String> other_element : other.paymentParams.entrySet()) {
8527
 
8528
          String other_element_key = other_element.getKey();
8529
          String other_element_value = other_element.getValue();
8530
 
8531
          String __this__paymentParams_copy_key = other_element_key;
8532
 
8533
          String __this__paymentParams_copy_value = other_element_value;
8534
 
8535
          __this__paymentParams.put(__this__paymentParams_copy_key, __this__paymentParams_copy_value);
8536
        }
8537
        this.paymentParams = __this__paymentParams;
8538
      }
8539
    }
8540
 
8541
    public updateAndCaptureEbsPayment_args deepCopy() {
8542
      return new updateAndCaptureEbsPayment_args(this);
8543
    }
8544
 
8545
    @Deprecated
8546
    public updateAndCaptureEbsPayment_args clone() {
8547
      return new updateAndCaptureEbsPayment_args(this);
8548
    }
8549
 
8550
    public int getPaymentParamsSize() {
8551
      return (this.paymentParams == null) ? 0 : this.paymentParams.size();
8552
    }
8553
 
8554
    public void putToPaymentParams(String key, String val) {
8555
      if (this.paymentParams == null) {
8556
        this.paymentParams = new HashMap<String,String>();
8557
      }
8558
      this.paymentParams.put(key, val);
8559
    }
8560
 
8561
    public Map<String,String> getPaymentParams() {
8562
      return this.paymentParams;
8563
    }
8564
 
8565
    public updateAndCaptureEbsPayment_args setPaymentParams(Map<String,String> paymentParams) {
8566
      this.paymentParams = paymentParams;
8567
      return this;
8568
    }
8569
 
8570
    public void unsetPaymentParams() {
8571
      this.paymentParams = null;
8572
    }
8573
 
8574
    /** Returns true if field paymentParams is set (has been asigned a value) and false otherwise */
8575
    public boolean isSetPaymentParams() {
8576
      return this.paymentParams != null;
8577
    }
8578
 
8579
    public void setPaymentParamsIsSet(boolean value) {
8580
      if (!value) {
8581
        this.paymentParams = null;
8582
      }
8583
    }
8584
 
8585
    public void setFieldValue(_Fields field, Object value) {
8586
      switch (field) {
8587
      case PAYMENT_PARAMS:
8588
        if (value == null) {
8589
          unsetPaymentParams();
8590
        } else {
8591
          setPaymentParams((Map<String,String>)value);
8592
        }
8593
        break;
8594
 
8595
      }
8596
    }
8597
 
8598
    public void setFieldValue(int fieldID, Object value) {
8599
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
8600
    }
8601
 
8602
    public Object getFieldValue(_Fields field) {
8603
      switch (field) {
8604
      case PAYMENT_PARAMS:
8605
        return getPaymentParams();
8606
 
8607
      }
8608
      throw new IllegalStateException();
8609
    }
8610
 
8611
    public Object getFieldValue(int fieldId) {
8612
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
8613
    }
8614
 
8615
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
8616
    public boolean isSet(_Fields field) {
8617
      switch (field) {
8618
      case PAYMENT_PARAMS:
8619
        return isSetPaymentParams();
8620
      }
8621
      throw new IllegalStateException();
8622
    }
8623
 
8624
    public boolean isSet(int fieldID) {
8625
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
8626
    }
8627
 
8628
    @Override
8629
    public boolean equals(Object that) {
8630
      if (that == null)
8631
        return false;
8632
      if (that instanceof updateAndCaptureEbsPayment_args)
8633
        return this.equals((updateAndCaptureEbsPayment_args)that);
8634
      return false;
8635
    }
8636
 
8637
    public boolean equals(updateAndCaptureEbsPayment_args that) {
8638
      if (that == null)
8639
        return false;
8640
 
8641
      boolean this_present_paymentParams = true && this.isSetPaymentParams();
8642
      boolean that_present_paymentParams = true && that.isSetPaymentParams();
8643
      if (this_present_paymentParams || that_present_paymentParams) {
8644
        if (!(this_present_paymentParams && that_present_paymentParams))
8645
          return false;
8646
        if (!this.paymentParams.equals(that.paymentParams))
8647
          return false;
8648
      }
8649
 
8650
      return true;
8651
    }
8652
 
8653
    @Override
8654
    public int hashCode() {
8655
      return 0;
8656
    }
8657
 
8658
    public void read(TProtocol iprot) throws TException {
8659
      TField field;
8660
      iprot.readStructBegin();
8661
      while (true)
8662
      {
8663
        field = iprot.readFieldBegin();
8664
        if (field.type == TType.STOP) { 
8665
          break;
8666
        }
8667
        _Fields fieldId = _Fields.findByThriftId(field.id);
8668
        if (fieldId == null) {
8669
          TProtocolUtil.skip(iprot, field.type);
8670
        } else {
8671
          switch (fieldId) {
8672
            case PAYMENT_PARAMS:
8673
              if (field.type == TType.MAP) {
8674
                {
8675
                  TMap _map28 = iprot.readMapBegin();
8676
                  this.paymentParams = new HashMap<String,String>(2*_map28.size);
8677
                  for (int _i29 = 0; _i29 < _map28.size; ++_i29)
8678
                  {
8679
                    String _key30;
8680
                    String _val31;
8681
                    _key30 = iprot.readString();
8682
                    _val31 = iprot.readString();
8683
                    this.paymentParams.put(_key30, _val31);
8684
                  }
8685
                  iprot.readMapEnd();
8686
                }
8687
              } else { 
8688
                TProtocolUtil.skip(iprot, field.type);
8689
              }
8690
              break;
8691
          }
8692
          iprot.readFieldEnd();
8693
        }
8694
      }
8695
      iprot.readStructEnd();
8696
      validate();
8697
    }
8698
 
8699
    public void write(TProtocol oprot) throws TException {
8700
      validate();
8701
 
8702
      oprot.writeStructBegin(STRUCT_DESC);
8703
      if (this.paymentParams != null) {
8704
        oprot.writeFieldBegin(PAYMENT_PARAMS_FIELD_DESC);
8705
        {
8706
          oprot.writeMapBegin(new TMap(TType.STRING, TType.STRING, this.paymentParams.size()));
8707
          for (Map.Entry<String, String> _iter32 : this.paymentParams.entrySet())
8708
          {
8709
            oprot.writeString(_iter32.getKey());
8710
            oprot.writeString(_iter32.getValue());
8711
          }
8712
          oprot.writeMapEnd();
8713
        }
8714
        oprot.writeFieldEnd();
8715
      }
8716
      oprot.writeFieldStop();
8717
      oprot.writeStructEnd();
8718
    }
8719
 
8720
    @Override
8721
    public String toString() {
8722
      StringBuilder sb = new StringBuilder("updateAndCaptureEbsPayment_args(");
8723
      boolean first = true;
8724
 
8725
      sb.append("paymentParams:");
8726
      if (this.paymentParams == null) {
8727
        sb.append("null");
8728
      } else {
8729
        sb.append(this.paymentParams);
8730
      }
8731
      first = false;
8732
      sb.append(")");
8733
      return sb.toString();
8734
    }
8735
 
8736
    public void validate() throws TException {
8737
      // check for required fields
8738
    }
8739
 
8740
  }
8741
 
8742
  public static class updateAndCaptureEbsPayment_result implements TBase<updateAndCaptureEbsPayment_result._Fields>, java.io.Serializable, Cloneable, Comparable<updateAndCaptureEbsPayment_result>   {
8743
    private static final TStruct STRUCT_DESC = new TStruct("updateAndCaptureEbsPayment_result");
8744
 
8745
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0);
8746
    private static final TField PE_FIELD_DESC = new TField("pe", TType.STRUCT, (short)1);
8747
 
8748
    private Payment success;
8749
    private PaymentException pe;
8750
 
8751
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
8752
    public enum _Fields implements TFieldIdEnum {
8753
      SUCCESS((short)0, "success"),
8754
      PE((short)1, "pe");
8755
 
8756
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
8757
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8758
 
8759
      static {
8760
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8761
          byId.put((int)field._thriftId, field);
8762
          byName.put(field.getFieldName(), field);
8763
        }
8764
      }
8765
 
8766
      /**
8767
       * Find the _Fields constant that matches fieldId, or null if its not found.
8768
       */
8769
      public static _Fields findByThriftId(int fieldId) {
8770
        return byId.get(fieldId);
8771
      }
8772
 
8773
      /**
8774
       * Find the _Fields constant that matches fieldId, throwing an exception
8775
       * if it is not found.
8776
       */
8777
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8778
        _Fields fields = findByThriftId(fieldId);
8779
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8780
        return fields;
8781
      }
8782
 
8783
      /**
8784
       * Find the _Fields constant that matches name, or null if its not found.
8785
       */
8786
      public static _Fields findByName(String name) {
8787
        return byName.get(name);
8788
      }
8789
 
8790
      private final short _thriftId;
8791
      private final String _fieldName;
8792
 
8793
      _Fields(short thriftId, String fieldName) {
8794
        _thriftId = thriftId;
8795
        _fieldName = fieldName;
8796
      }
8797
 
8798
      public short getThriftFieldId() {
8799
        return _thriftId;
8800
      }
8801
 
8802
      public String getFieldName() {
8803
        return _fieldName;
8804
      }
8805
    }
8806
 
8807
    // isset id assignments
8808
 
8809
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
8810
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
8811
          new StructMetaData(TType.STRUCT, Payment.class)));
8812
      put(_Fields.PE, new FieldMetaData("pe", TFieldRequirementType.DEFAULT, 
8813
          new FieldValueMetaData(TType.STRUCT)));
8814
    }});
8815
 
8816
    static {
8817
      FieldMetaData.addStructMetaDataMap(updateAndCaptureEbsPayment_result.class, metaDataMap);
8818
    }
8819
 
8820
    public updateAndCaptureEbsPayment_result() {
8821
    }
8822
 
8823
    public updateAndCaptureEbsPayment_result(
8824
      Payment success,
8825
      PaymentException pe)
8826
    {
8827
      this();
8828
      this.success = success;
8829
      this.pe = pe;
8830
    }
8831
 
8832
    /**
8833
     * Performs a deep copy on <i>other</i>.
8834
     */
8835
    public updateAndCaptureEbsPayment_result(updateAndCaptureEbsPayment_result other) {
8836
      if (other.isSetSuccess()) {
8837
        this.success = new Payment(other.success);
8838
      }
8839
      if (other.isSetPe()) {
8840
        this.pe = new PaymentException(other.pe);
8841
      }
8842
    }
8843
 
8844
    public updateAndCaptureEbsPayment_result deepCopy() {
8845
      return new updateAndCaptureEbsPayment_result(this);
8846
    }
8847
 
8848
    @Deprecated
8849
    public updateAndCaptureEbsPayment_result clone() {
8850
      return new updateAndCaptureEbsPayment_result(this);
8851
    }
8852
 
8853
    public Payment getSuccess() {
8854
      return this.success;
8855
    }
8856
 
8857
    public updateAndCaptureEbsPayment_result setSuccess(Payment success) {
8858
      this.success = success;
8859
      return this;
8860
    }
8861
 
8862
    public void unsetSuccess() {
8863
      this.success = null;
8864
    }
8865
 
8866
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
8867
    public boolean isSetSuccess() {
8868
      return this.success != null;
8869
    }
8870
 
8871
    public void setSuccessIsSet(boolean value) {
8872
      if (!value) {
8873
        this.success = null;
8874
      }
8875
    }
8876
 
8877
    public PaymentException getPe() {
8878
      return this.pe;
8879
    }
8880
 
8881
    public updateAndCaptureEbsPayment_result setPe(PaymentException pe) {
8882
      this.pe = pe;
8883
      return this;
8884
    }
8885
 
8886
    public void unsetPe() {
8887
      this.pe = null;
8888
    }
8889
 
8890
    /** Returns true if field pe is set (has been asigned a value) and false otherwise */
8891
    public boolean isSetPe() {
8892
      return this.pe != null;
8893
    }
8894
 
8895
    public void setPeIsSet(boolean value) {
8896
      if (!value) {
8897
        this.pe = null;
8898
      }
8899
    }
8900
 
8901
    public void setFieldValue(_Fields field, Object value) {
8902
      switch (field) {
8903
      case SUCCESS:
8904
        if (value == null) {
8905
          unsetSuccess();
8906
        } else {
8907
          setSuccess((Payment)value);
8908
        }
8909
        break;
8910
 
8911
      case PE:
8912
        if (value == null) {
8913
          unsetPe();
8914
        } else {
8915
          setPe((PaymentException)value);
8916
        }
8917
        break;
8918
 
8919
      }
8920
    }
8921
 
8922
    public void setFieldValue(int fieldID, Object value) {
8923
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
8924
    }
8925
 
8926
    public Object getFieldValue(_Fields field) {
8927
      switch (field) {
8928
      case SUCCESS:
8929
        return getSuccess();
8930
 
8931
      case PE:
8932
        return getPe();
8933
 
8934
      }
8935
      throw new IllegalStateException();
8936
    }
8937
 
8938
    public Object getFieldValue(int fieldId) {
8939
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
8940
    }
8941
 
8942
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
8943
    public boolean isSet(_Fields field) {
8944
      switch (field) {
8945
      case SUCCESS:
8946
        return isSetSuccess();
8947
      case PE:
8948
        return isSetPe();
8949
      }
8950
      throw new IllegalStateException();
8951
    }
8952
 
8953
    public boolean isSet(int fieldID) {
8954
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
8955
    }
8956
 
8957
    @Override
8958
    public boolean equals(Object that) {
8959
      if (that == null)
8960
        return false;
8961
      if (that instanceof updateAndCaptureEbsPayment_result)
8962
        return this.equals((updateAndCaptureEbsPayment_result)that);
8963
      return false;
8964
    }
8965
 
8966
    public boolean equals(updateAndCaptureEbsPayment_result that) {
8967
      if (that == null)
8968
        return false;
8969
 
8970
      boolean this_present_success = true && this.isSetSuccess();
8971
      boolean that_present_success = true && that.isSetSuccess();
8972
      if (this_present_success || that_present_success) {
8973
        if (!(this_present_success && that_present_success))
8974
          return false;
8975
        if (!this.success.equals(that.success))
8976
          return false;
8977
      }
8978
 
8979
      boolean this_present_pe = true && this.isSetPe();
8980
      boolean that_present_pe = true && that.isSetPe();
8981
      if (this_present_pe || that_present_pe) {
8982
        if (!(this_present_pe && that_present_pe))
8983
          return false;
8984
        if (!this.pe.equals(that.pe))
8985
          return false;
8986
      }
8987
 
8988
      return true;
8989
    }
8990
 
8991
    @Override
8992
    public int hashCode() {
8993
      return 0;
8994
    }
8995
 
8996
    public int compareTo(updateAndCaptureEbsPayment_result other) {
8997
      if (!getClass().equals(other.getClass())) {
8998
        return getClass().getName().compareTo(other.getClass().getName());
8999
      }
9000
 
9001
      int lastComparison = 0;
9002
      updateAndCaptureEbsPayment_result typedOther = (updateAndCaptureEbsPayment_result)other;
9003
 
9004
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
9005
      if (lastComparison != 0) {
9006
        return lastComparison;
9007
      }
9008
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
9009
      if (lastComparison != 0) {
9010
        return lastComparison;
9011
      }
9012
      lastComparison = Boolean.valueOf(isSetPe()).compareTo(isSetPe());
9013
      if (lastComparison != 0) {
9014
        return lastComparison;
9015
      }
9016
      lastComparison = TBaseHelper.compareTo(pe, typedOther.pe);
9017
      if (lastComparison != 0) {
9018
        return lastComparison;
9019
      }
9020
      return 0;
9021
    }
9022
 
9023
    public void read(TProtocol iprot) throws TException {
9024
      TField field;
9025
      iprot.readStructBegin();
9026
      while (true)
9027
      {
9028
        field = iprot.readFieldBegin();
9029
        if (field.type == TType.STOP) { 
9030
          break;
9031
        }
9032
        _Fields fieldId = _Fields.findByThriftId(field.id);
9033
        if (fieldId == null) {
9034
          TProtocolUtil.skip(iprot, field.type);
9035
        } else {
9036
          switch (fieldId) {
9037
            case SUCCESS:
9038
              if (field.type == TType.STRUCT) {
9039
                this.success = new Payment();
9040
                this.success.read(iprot);
9041
              } else { 
9042
                TProtocolUtil.skip(iprot, field.type);
9043
              }
9044
              break;
9045
            case PE:
9046
              if (field.type == TType.STRUCT) {
9047
                this.pe = new PaymentException();
9048
                this.pe.read(iprot);
9049
              } else { 
9050
                TProtocolUtil.skip(iprot, field.type);
9051
              }
9052
              break;
9053
          }
9054
          iprot.readFieldEnd();
9055
        }
9056
      }
9057
      iprot.readStructEnd();
9058
      validate();
9059
    }
9060
 
9061
    public void write(TProtocol oprot) throws TException {
9062
      oprot.writeStructBegin(STRUCT_DESC);
9063
 
9064
      if (this.isSetSuccess()) {
9065
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
9066
        this.success.write(oprot);
9067
        oprot.writeFieldEnd();
9068
      } else if (this.isSetPe()) {
9069
        oprot.writeFieldBegin(PE_FIELD_DESC);
9070
        this.pe.write(oprot);
9071
        oprot.writeFieldEnd();
9072
      }
9073
      oprot.writeFieldStop();
9074
      oprot.writeStructEnd();
9075
    }
9076
 
9077
    @Override
9078
    public String toString() {
9079
      StringBuilder sb = new StringBuilder("updateAndCaptureEbsPayment_result(");
9080
      boolean first = true;
9081
 
9082
      sb.append("success:");
9083
      if (this.success == null) {
9084
        sb.append("null");
9085
      } else {
9086
        sb.append(this.success);
9087
      }
9088
      first = false;
9089
      if (!first) sb.append(", ");
9090
      sb.append("pe:");
9091
      if (this.pe == null) {
9092
        sb.append("null");
9093
      } else {
9094
        sb.append(this.pe);
9095
      }
9096
      first = false;
9097
      sb.append(")");
9098
      return sb.toString();
9099
    }
9100
 
9101
    public void validate() throws TException {
9102
      // check for required fields
9103
    }
9104
 
9105
  }
9106
 
2708 chandransh 9107
  public static class captureEbsPayment_args implements TBase<captureEbsPayment_args._Fields>, java.io.Serializable, Cloneable, Comparable<captureEbsPayment_args>   {
9108
    private static final TStruct STRUCT_DESC = new TStruct("captureEbsPayment_args");
9109
 
9110
    private static final TField MERCHANT_PAYMENT_ID_FIELD_DESC = new TField("merchantPaymentId", TType.I64, (short)1);
9111
 
9112
    private long merchantPaymentId;
9113
 
9114
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
9115
    public enum _Fields implements TFieldIdEnum {
9116
      MERCHANT_PAYMENT_ID((short)1, "merchantPaymentId");
9117
 
9118
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
9119
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
9120
 
9121
      static {
9122
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
9123
          byId.put((int)field._thriftId, field);
9124
          byName.put(field.getFieldName(), field);
9125
        }
9126
      }
9127
 
9128
      /**
9129
       * Find the _Fields constant that matches fieldId, or null if its not found.
9130
       */
9131
      public static _Fields findByThriftId(int fieldId) {
9132
        return byId.get(fieldId);
9133
      }
9134
 
9135
      /**
9136
       * Find the _Fields constant that matches fieldId, throwing an exception
9137
       * if it is not found.
9138
       */
9139
      public static _Fields findByThriftIdOrThrow(int fieldId) {
9140
        _Fields fields = findByThriftId(fieldId);
9141
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
9142
        return fields;
9143
      }
9144
 
9145
      /**
9146
       * Find the _Fields constant that matches name, or null if its not found.
9147
       */
9148
      public static _Fields findByName(String name) {
9149
        return byName.get(name);
9150
      }
9151
 
9152
      private final short _thriftId;
9153
      private final String _fieldName;
9154
 
9155
      _Fields(short thriftId, String fieldName) {
9156
        _thriftId = thriftId;
9157
        _fieldName = fieldName;
9158
      }
9159
 
9160
      public short getThriftFieldId() {
9161
        return _thriftId;
9162
      }
9163
 
9164
      public String getFieldName() {
9165
        return _fieldName;
9166
      }
9167
    }
9168
 
9169
    // isset id assignments
9170
    private static final int __MERCHANTPAYMENTID_ISSET_ID = 0;
9171
    private BitSet __isset_bit_vector = new BitSet(1);
9172
 
9173
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
9174
      put(_Fields.MERCHANT_PAYMENT_ID, new FieldMetaData("merchantPaymentId", TFieldRequirementType.DEFAULT, 
9175
          new FieldValueMetaData(TType.I64)));
9176
    }});
9177
 
9178
    static {
9179
      FieldMetaData.addStructMetaDataMap(captureEbsPayment_args.class, metaDataMap);
9180
    }
9181
 
9182
    public captureEbsPayment_args() {
9183
    }
9184
 
9185
    public captureEbsPayment_args(
9186
      long merchantPaymentId)
9187
    {
9188
      this();
9189
      this.merchantPaymentId = merchantPaymentId;
9190
      setMerchantPaymentIdIsSet(true);
9191
    }
9192
 
9193
    /**
9194
     * Performs a deep copy on <i>other</i>.
9195
     */
9196
    public captureEbsPayment_args(captureEbsPayment_args other) {
9197
      __isset_bit_vector.clear();
9198
      __isset_bit_vector.or(other.__isset_bit_vector);
9199
      this.merchantPaymentId = other.merchantPaymentId;
9200
    }
9201
 
9202
    public captureEbsPayment_args deepCopy() {
9203
      return new captureEbsPayment_args(this);
9204
    }
9205
 
9206
    @Deprecated
9207
    public captureEbsPayment_args clone() {
9208
      return new captureEbsPayment_args(this);
9209
    }
9210
 
9211
    public long getMerchantPaymentId() {
9212
      return this.merchantPaymentId;
9213
    }
9214
 
9215
    public captureEbsPayment_args setMerchantPaymentId(long merchantPaymentId) {
9216
      this.merchantPaymentId = merchantPaymentId;
9217
      setMerchantPaymentIdIsSet(true);
9218
      return this;
9219
    }
9220
 
9221
    public void unsetMerchantPaymentId() {
9222
      __isset_bit_vector.clear(__MERCHANTPAYMENTID_ISSET_ID);
9223
    }
9224
 
9225
    /** Returns true if field merchantPaymentId is set (has been asigned a value) and false otherwise */
9226
    public boolean isSetMerchantPaymentId() {
9227
      return __isset_bit_vector.get(__MERCHANTPAYMENTID_ISSET_ID);
9228
    }
9229
 
9230
    public void setMerchantPaymentIdIsSet(boolean value) {
9231
      __isset_bit_vector.set(__MERCHANTPAYMENTID_ISSET_ID, value);
9232
    }
9233
 
9234
    public void setFieldValue(_Fields field, Object value) {
9235
      switch (field) {
9236
      case MERCHANT_PAYMENT_ID:
9237
        if (value == null) {
9238
          unsetMerchantPaymentId();
9239
        } else {
9240
          setMerchantPaymentId((Long)value);
9241
        }
9242
        break;
9243
 
9244
      }
9245
    }
9246
 
9247
    public void setFieldValue(int fieldID, Object value) {
9248
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
9249
    }
9250
 
9251
    public Object getFieldValue(_Fields field) {
9252
      switch (field) {
9253
      case MERCHANT_PAYMENT_ID:
9254
        return new Long(getMerchantPaymentId());
9255
 
9256
      }
9257
      throw new IllegalStateException();
9258
    }
9259
 
9260
    public Object getFieldValue(int fieldId) {
9261
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
9262
    }
9263
 
9264
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
9265
    public boolean isSet(_Fields field) {
9266
      switch (field) {
9267
      case MERCHANT_PAYMENT_ID:
9268
        return isSetMerchantPaymentId();
9269
      }
9270
      throw new IllegalStateException();
9271
    }
9272
 
9273
    public boolean isSet(int fieldID) {
9274
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
9275
    }
9276
 
9277
    @Override
9278
    public boolean equals(Object that) {
9279
      if (that == null)
9280
        return false;
9281
      if (that instanceof captureEbsPayment_args)
9282
        return this.equals((captureEbsPayment_args)that);
9283
      return false;
9284
    }
9285
 
9286
    public boolean equals(captureEbsPayment_args that) {
9287
      if (that == null)
9288
        return false;
9289
 
9290
      boolean this_present_merchantPaymentId = true;
9291
      boolean that_present_merchantPaymentId = true;
9292
      if (this_present_merchantPaymentId || that_present_merchantPaymentId) {
9293
        if (!(this_present_merchantPaymentId && that_present_merchantPaymentId))
9294
          return false;
9295
        if (this.merchantPaymentId != that.merchantPaymentId)
9296
          return false;
9297
      }
9298
 
9299
      return true;
9300
    }
9301
 
9302
    @Override
9303
    public int hashCode() {
9304
      return 0;
9305
    }
9306
 
9307
    public int compareTo(captureEbsPayment_args other) {
9308
      if (!getClass().equals(other.getClass())) {
9309
        return getClass().getName().compareTo(other.getClass().getName());
9310
      }
9311
 
9312
      int lastComparison = 0;
9313
      captureEbsPayment_args typedOther = (captureEbsPayment_args)other;
9314
 
9315
      lastComparison = Boolean.valueOf(isSetMerchantPaymentId()).compareTo(isSetMerchantPaymentId());
9316
      if (lastComparison != 0) {
9317
        return lastComparison;
9318
      }
9319
      lastComparison = TBaseHelper.compareTo(merchantPaymentId, typedOther.merchantPaymentId);
9320
      if (lastComparison != 0) {
9321
        return lastComparison;
9322
      }
9323
      return 0;
9324
    }
9325
 
9326
    public void read(TProtocol iprot) throws TException {
9327
      TField field;
9328
      iprot.readStructBegin();
9329
      while (true)
9330
      {
9331
        field = iprot.readFieldBegin();
9332
        if (field.type == TType.STOP) { 
9333
          break;
9334
        }
9335
        _Fields fieldId = _Fields.findByThriftId(field.id);
9336
        if (fieldId == null) {
9337
          TProtocolUtil.skip(iprot, field.type);
9338
        } else {
9339
          switch (fieldId) {
9340
            case MERCHANT_PAYMENT_ID:
9341
              if (field.type == TType.I64) {
9342
                this.merchantPaymentId = iprot.readI64();
9343
                setMerchantPaymentIdIsSet(true);
9344
              } else { 
9345
                TProtocolUtil.skip(iprot, field.type);
9346
              }
9347
              break;
9348
          }
9349
          iprot.readFieldEnd();
9350
        }
9351
      }
9352
      iprot.readStructEnd();
9353
      validate();
9354
    }
9355
 
9356
    public void write(TProtocol oprot) throws TException {
9357
      validate();
9358
 
9359
      oprot.writeStructBegin(STRUCT_DESC);
9360
      oprot.writeFieldBegin(MERCHANT_PAYMENT_ID_FIELD_DESC);
9361
      oprot.writeI64(this.merchantPaymentId);
9362
      oprot.writeFieldEnd();
9363
      oprot.writeFieldStop();
9364
      oprot.writeStructEnd();
9365
    }
9366
 
9367
    @Override
9368
    public String toString() {
9369
      StringBuilder sb = new StringBuilder("captureEbsPayment_args(");
9370
      boolean first = true;
9371
 
9372
      sb.append("merchantPaymentId:");
9373
      sb.append(this.merchantPaymentId);
9374
      first = false;
9375
      sb.append(")");
9376
      return sb.toString();
9377
    }
9378
 
9379
    public void validate() throws TException {
9380
      // check for required fields
9381
    }
9382
 
9383
  }
9384
 
9385
  public static class captureEbsPayment_result implements TBase<captureEbsPayment_result._Fields>, java.io.Serializable, Cloneable   {
9386
    private static final TStruct STRUCT_DESC = new TStruct("captureEbsPayment_result");
9387
 
9388
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.MAP, (short)0);
9389
    private static final TField PE_FIELD_DESC = new TField("pe", TType.STRUCT, (short)1);
9390
 
9391
    private Map<String,String> success;
9392
    private PaymentException pe;
9393
 
9394
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
9395
    public enum _Fields implements TFieldIdEnum {
9396
      SUCCESS((short)0, "success"),
9397
      PE((short)1, "pe");
9398
 
9399
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
9400
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
9401
 
9402
      static {
9403
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
9404
          byId.put((int)field._thriftId, field);
9405
          byName.put(field.getFieldName(), field);
9406
        }
9407
      }
9408
 
9409
      /**
9410
       * Find the _Fields constant that matches fieldId, or null if its not found.
9411
       */
9412
      public static _Fields findByThriftId(int fieldId) {
9413
        return byId.get(fieldId);
9414
      }
9415
 
9416
      /**
9417
       * Find the _Fields constant that matches fieldId, throwing an exception
9418
       * if it is not found.
9419
       */
9420
      public static _Fields findByThriftIdOrThrow(int fieldId) {
9421
        _Fields fields = findByThriftId(fieldId);
9422
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
9423
        return fields;
9424
      }
9425
 
9426
      /**
9427
       * Find the _Fields constant that matches name, or null if its not found.
9428
       */
9429
      public static _Fields findByName(String name) {
9430
        return byName.get(name);
9431
      }
9432
 
9433
      private final short _thriftId;
9434
      private final String _fieldName;
9435
 
9436
      _Fields(short thriftId, String fieldName) {
9437
        _thriftId = thriftId;
9438
        _fieldName = fieldName;
9439
      }
9440
 
9441
      public short getThriftFieldId() {
9442
        return _thriftId;
9443
      }
9444
 
9445
      public String getFieldName() {
9446
        return _fieldName;
9447
      }
9448
    }
9449
 
9450
    // isset id assignments
9451
 
9452
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
9453
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
9454
          new MapMetaData(TType.MAP, 
9455
              new FieldValueMetaData(TType.STRING), 
9456
              new FieldValueMetaData(TType.STRING))));
9457
      put(_Fields.PE, new FieldMetaData("pe", TFieldRequirementType.DEFAULT, 
9458
          new FieldValueMetaData(TType.STRUCT)));
9459
    }});
9460
 
9461
    static {
9462
      FieldMetaData.addStructMetaDataMap(captureEbsPayment_result.class, metaDataMap);
9463
    }
9464
 
9465
    public captureEbsPayment_result() {
9466
    }
9467
 
9468
    public captureEbsPayment_result(
9469
      Map<String,String> success,
9470
      PaymentException pe)
9471
    {
9472
      this();
9473
      this.success = success;
9474
      this.pe = pe;
9475
    }
9476
 
9477
    /**
9478
     * Performs a deep copy on <i>other</i>.
9479
     */
9480
    public captureEbsPayment_result(captureEbsPayment_result other) {
9481
      if (other.isSetSuccess()) {
9482
        Map<String,String> __this__success = new HashMap<String,String>();
9483
        for (Map.Entry<String, String> other_element : other.success.entrySet()) {
9484
 
9485
          String other_element_key = other_element.getKey();
9486
          String other_element_value = other_element.getValue();
9487
 
9488
          String __this__success_copy_key = other_element_key;
9489
 
9490
          String __this__success_copy_value = other_element_value;
9491
 
9492
          __this__success.put(__this__success_copy_key, __this__success_copy_value);
9493
        }
9494
        this.success = __this__success;
9495
      }
9496
      if (other.isSetPe()) {
9497
        this.pe = new PaymentException(other.pe);
9498
      }
9499
    }
9500
 
9501
    public captureEbsPayment_result deepCopy() {
9502
      return new captureEbsPayment_result(this);
9503
    }
9504
 
9505
    @Deprecated
9506
    public captureEbsPayment_result clone() {
9507
      return new captureEbsPayment_result(this);
9508
    }
9509
 
9510
    public int getSuccessSize() {
9511
      return (this.success == null) ? 0 : this.success.size();
9512
    }
9513
 
9514
    public void putToSuccess(String key, String val) {
9515
      if (this.success == null) {
9516
        this.success = new HashMap<String,String>();
9517
      }
9518
      this.success.put(key, val);
9519
    }
9520
 
9521
    public Map<String,String> getSuccess() {
9522
      return this.success;
9523
    }
9524
 
9525
    public captureEbsPayment_result setSuccess(Map<String,String> success) {
9526
      this.success = success;
9527
      return this;
9528
    }
9529
 
9530
    public void unsetSuccess() {
9531
      this.success = null;
9532
    }
9533
 
9534
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
9535
    public boolean isSetSuccess() {
9536
      return this.success != null;
9537
    }
9538
 
9539
    public void setSuccessIsSet(boolean value) {
9540
      if (!value) {
9541
        this.success = null;
9542
      }
9543
    }
9544
 
9545
    public PaymentException getPe() {
9546
      return this.pe;
9547
    }
9548
 
9549
    public captureEbsPayment_result setPe(PaymentException pe) {
9550
      this.pe = pe;
9551
      return this;
9552
    }
9553
 
9554
    public void unsetPe() {
9555
      this.pe = null;
9556
    }
9557
 
9558
    /** Returns true if field pe is set (has been asigned a value) and false otherwise */
9559
    public boolean isSetPe() {
9560
      return this.pe != null;
9561
    }
9562
 
9563
    public void setPeIsSet(boolean value) {
9564
      if (!value) {
9565
        this.pe = null;
9566
      }
9567
    }
9568
 
9569
    public void setFieldValue(_Fields field, Object value) {
9570
      switch (field) {
9571
      case SUCCESS:
9572
        if (value == null) {
9573
          unsetSuccess();
9574
        } else {
9575
          setSuccess((Map<String,String>)value);
9576
        }
9577
        break;
9578
 
9579
      case PE:
9580
        if (value == null) {
9581
          unsetPe();
9582
        } else {
9583
          setPe((PaymentException)value);
9584
        }
9585
        break;
9586
 
9587
      }
9588
    }
9589
 
9590
    public void setFieldValue(int fieldID, Object value) {
9591
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
9592
    }
9593
 
9594
    public Object getFieldValue(_Fields field) {
9595
      switch (field) {
9596
      case SUCCESS:
9597
        return getSuccess();
9598
 
9599
      case PE:
9600
        return getPe();
9601
 
9602
      }
9603
      throw new IllegalStateException();
9604
    }
9605
 
9606
    public Object getFieldValue(int fieldId) {
9607
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
9608
    }
9609
 
9610
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
9611
    public boolean isSet(_Fields field) {
9612
      switch (field) {
9613
      case SUCCESS:
9614
        return isSetSuccess();
9615
      case PE:
9616
        return isSetPe();
9617
      }
9618
      throw new IllegalStateException();
9619
    }
9620
 
9621
    public boolean isSet(int fieldID) {
9622
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
9623
    }
9624
 
9625
    @Override
9626
    public boolean equals(Object that) {
9627
      if (that == null)
9628
        return false;
9629
      if (that instanceof captureEbsPayment_result)
9630
        return this.equals((captureEbsPayment_result)that);
9631
      return false;
9632
    }
9633
 
9634
    public boolean equals(captureEbsPayment_result that) {
9635
      if (that == null)
9636
        return false;
9637
 
9638
      boolean this_present_success = true && this.isSetSuccess();
9639
      boolean that_present_success = true && that.isSetSuccess();
9640
      if (this_present_success || that_present_success) {
9641
        if (!(this_present_success && that_present_success))
9642
          return false;
9643
        if (!this.success.equals(that.success))
9644
          return false;
9645
      }
9646
 
9647
      boolean this_present_pe = true && this.isSetPe();
9648
      boolean that_present_pe = true && that.isSetPe();
9649
      if (this_present_pe || that_present_pe) {
9650
        if (!(this_present_pe && that_present_pe))
9651
          return false;
9652
        if (!this.pe.equals(that.pe))
9653
          return false;
9654
      }
9655
 
9656
      return true;
9657
    }
9658
 
9659
    @Override
9660
    public int hashCode() {
9661
      return 0;
9662
    }
9663
 
9664
    public void read(TProtocol iprot) throws TException {
9665
      TField field;
9666
      iprot.readStructBegin();
9667
      while (true)
9668
      {
9669
        field = iprot.readFieldBegin();
9670
        if (field.type == TType.STOP) { 
9671
          break;
9672
        }
9673
        _Fields fieldId = _Fields.findByThriftId(field.id);
9674
        if (fieldId == null) {
9675
          TProtocolUtil.skip(iprot, field.type);
9676
        } else {
9677
          switch (fieldId) {
9678
            case SUCCESS:
9679
              if (field.type == TType.MAP) {
9680
                {
9681
                  TMap _map33 = iprot.readMapBegin();
9682
                  this.success = new HashMap<String,String>(2*_map33.size);
9683
                  for (int _i34 = 0; _i34 < _map33.size; ++_i34)
9684
                  {
9685
                    String _key35;
9686
                    String _val36;
9687
                    _key35 = iprot.readString();
9688
                    _val36 = iprot.readString();
9689
                    this.success.put(_key35, _val36);
9690
                  }
9691
                  iprot.readMapEnd();
9692
                }
9693
              } else { 
9694
                TProtocolUtil.skip(iprot, field.type);
9695
              }
9696
              break;
9697
            case PE:
9698
              if (field.type == TType.STRUCT) {
9699
                this.pe = new PaymentException();
9700
                this.pe.read(iprot);
9701
              } else { 
9702
                TProtocolUtil.skip(iprot, field.type);
9703
              }
9704
              break;
9705
          }
9706
          iprot.readFieldEnd();
9707
        }
9708
      }
9709
      iprot.readStructEnd();
9710
      validate();
9711
    }
9712
 
9713
    public void write(TProtocol oprot) throws TException {
9714
      oprot.writeStructBegin(STRUCT_DESC);
9715
 
9716
      if (this.isSetSuccess()) {
9717
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
9718
        {
9719
          oprot.writeMapBegin(new TMap(TType.STRING, TType.STRING, this.success.size()));
9720
          for (Map.Entry<String, String> _iter37 : this.success.entrySet())
9721
          {
9722
            oprot.writeString(_iter37.getKey());
9723
            oprot.writeString(_iter37.getValue());
9724
          }
9725
          oprot.writeMapEnd();
9726
        }
9727
        oprot.writeFieldEnd();
9728
      } else if (this.isSetPe()) {
9729
        oprot.writeFieldBegin(PE_FIELD_DESC);
9730
        this.pe.write(oprot);
9731
        oprot.writeFieldEnd();
9732
      }
9733
      oprot.writeFieldStop();
9734
      oprot.writeStructEnd();
9735
    }
9736
 
9737
    @Override
9738
    public String toString() {
9739
      StringBuilder sb = new StringBuilder("captureEbsPayment_result(");
9740
      boolean first = true;
9741
 
9742
      sb.append("success:");
9743
      if (this.success == null) {
9744
        sb.append("null");
9745
      } else {
9746
        sb.append(this.success);
9747
      }
9748
      first = false;
9749
      if (!first) sb.append(", ");
9750
      sb.append("pe:");
9751
      if (this.pe == null) {
9752
        sb.append("null");
9753
      } else {
9754
        sb.append(this.pe);
9755
      }
9756
      first = false;
9757
      sb.append(")");
9758
      return sb.toString();
9759
    }
9760
 
9761
    public void validate() throws TException {
9762
      // check for required fields
9763
    }
9764
 
9765
  }
9766
 
2462 chandransh 9767
  public static class captureHdfcPayment_args implements TBase<captureHdfcPayment_args._Fields>, java.io.Serializable, Cloneable, Comparable<captureHdfcPayment_args>   {
9768
    private static final TStruct STRUCT_DESC = new TStruct("captureHdfcPayment_args");
9769
 
9770
    private static final TField MERCHANT_PAYMENT_ID_FIELD_DESC = new TField("merchantPaymentId", TType.I64, (short)1);
9771
 
9772
    private long merchantPaymentId;
9773
 
9774
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
9775
    public enum _Fields implements TFieldIdEnum {
9776
      MERCHANT_PAYMENT_ID((short)1, "merchantPaymentId");
9777
 
9778
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
9779
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
9780
 
9781
      static {
9782
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
9783
          byId.put((int)field._thriftId, field);
9784
          byName.put(field.getFieldName(), field);
9785
        }
9786
      }
9787
 
9788
      /**
9789
       * Find the _Fields constant that matches fieldId, or null if its not found.
9790
       */
9791
      public static _Fields findByThriftId(int fieldId) {
9792
        return byId.get(fieldId);
9793
      }
9794
 
9795
      /**
9796
       * Find the _Fields constant that matches fieldId, throwing an exception
9797
       * if it is not found.
9798
       */
9799
      public static _Fields findByThriftIdOrThrow(int fieldId) {
9800
        _Fields fields = findByThriftId(fieldId);
9801
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
9802
        return fields;
9803
      }
9804
 
9805
      /**
9806
       * Find the _Fields constant that matches name, or null if its not found.
9807
       */
9808
      public static _Fields findByName(String name) {
9809
        return byName.get(name);
9810
      }
9811
 
9812
      private final short _thriftId;
9813
      private final String _fieldName;
9814
 
9815
      _Fields(short thriftId, String fieldName) {
9816
        _thriftId = thriftId;
9817
        _fieldName = fieldName;
9818
      }
9819
 
9820
      public short getThriftFieldId() {
9821
        return _thriftId;
9822
      }
9823
 
9824
      public String getFieldName() {
9825
        return _fieldName;
9826
      }
9827
    }
9828
 
9829
    // isset id assignments
9830
    private static final int __MERCHANTPAYMENTID_ISSET_ID = 0;
9831
    private BitSet __isset_bit_vector = new BitSet(1);
9832
 
9833
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
9834
      put(_Fields.MERCHANT_PAYMENT_ID, new FieldMetaData("merchantPaymentId", TFieldRequirementType.DEFAULT, 
9835
          new FieldValueMetaData(TType.I64)));
9836
    }});
9837
 
9838
    static {
9839
      FieldMetaData.addStructMetaDataMap(captureHdfcPayment_args.class, metaDataMap);
9840
    }
9841
 
9842
    public captureHdfcPayment_args() {
9843
    }
9844
 
9845
    public captureHdfcPayment_args(
9846
      long merchantPaymentId)
9847
    {
9848
      this();
9849
      this.merchantPaymentId = merchantPaymentId;
9850
      setMerchantPaymentIdIsSet(true);
9851
    }
9852
 
9853
    /**
9854
     * Performs a deep copy on <i>other</i>.
9855
     */
9856
    public captureHdfcPayment_args(captureHdfcPayment_args other) {
9857
      __isset_bit_vector.clear();
9858
      __isset_bit_vector.or(other.__isset_bit_vector);
9859
      this.merchantPaymentId = other.merchantPaymentId;
9860
    }
9861
 
9862
    public captureHdfcPayment_args deepCopy() {
9863
      return new captureHdfcPayment_args(this);
9864
    }
9865
 
9866
    @Deprecated
9867
    public captureHdfcPayment_args clone() {
9868
      return new captureHdfcPayment_args(this);
9869
    }
9870
 
9871
    public long getMerchantPaymentId() {
9872
      return this.merchantPaymentId;
9873
    }
9874
 
9875
    public captureHdfcPayment_args setMerchantPaymentId(long merchantPaymentId) {
9876
      this.merchantPaymentId = merchantPaymentId;
9877
      setMerchantPaymentIdIsSet(true);
9878
      return this;
9879
    }
9880
 
9881
    public void unsetMerchantPaymentId() {
9882
      __isset_bit_vector.clear(__MERCHANTPAYMENTID_ISSET_ID);
9883
    }
9884
 
9885
    /** Returns true if field merchantPaymentId is set (has been asigned a value) and false otherwise */
9886
    public boolean isSetMerchantPaymentId() {
9887
      return __isset_bit_vector.get(__MERCHANTPAYMENTID_ISSET_ID);
9888
    }
9889
 
9890
    public void setMerchantPaymentIdIsSet(boolean value) {
9891
      __isset_bit_vector.set(__MERCHANTPAYMENTID_ISSET_ID, value);
9892
    }
9893
 
9894
    public void setFieldValue(_Fields field, Object value) {
9895
      switch (field) {
9896
      case MERCHANT_PAYMENT_ID:
9897
        if (value == null) {
9898
          unsetMerchantPaymentId();
9899
        } else {
9900
          setMerchantPaymentId((Long)value);
9901
        }
9902
        break;
9903
 
9904
      }
9905
    }
9906
 
9907
    public void setFieldValue(int fieldID, Object value) {
9908
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
9909
    }
9910
 
9911
    public Object getFieldValue(_Fields field) {
9912
      switch (field) {
9913
      case MERCHANT_PAYMENT_ID:
9914
        return new Long(getMerchantPaymentId());
9915
 
9916
      }
9917
      throw new IllegalStateException();
9918
    }
9919
 
9920
    public Object getFieldValue(int fieldId) {
9921
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
9922
    }
9923
 
9924
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
9925
    public boolean isSet(_Fields field) {
9926
      switch (field) {
9927
      case MERCHANT_PAYMENT_ID:
9928
        return isSetMerchantPaymentId();
9929
      }
9930
      throw new IllegalStateException();
9931
    }
9932
 
9933
    public boolean isSet(int fieldID) {
9934
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
9935
    }
9936
 
9937
    @Override
9938
    public boolean equals(Object that) {
9939
      if (that == null)
9940
        return false;
9941
      if (that instanceof captureHdfcPayment_args)
9942
        return this.equals((captureHdfcPayment_args)that);
9943
      return false;
9944
    }
9945
 
9946
    public boolean equals(captureHdfcPayment_args that) {
9947
      if (that == null)
9948
        return false;
9949
 
9950
      boolean this_present_merchantPaymentId = true;
9951
      boolean that_present_merchantPaymentId = true;
9952
      if (this_present_merchantPaymentId || that_present_merchantPaymentId) {
9953
        if (!(this_present_merchantPaymentId && that_present_merchantPaymentId))
9954
          return false;
9955
        if (this.merchantPaymentId != that.merchantPaymentId)
9956
          return false;
9957
      }
9958
 
9959
      return true;
9960
    }
9961
 
9962
    @Override
9963
    public int hashCode() {
9964
      return 0;
9965
    }
9966
 
9967
    public int compareTo(captureHdfcPayment_args other) {
9968
      if (!getClass().equals(other.getClass())) {
9969
        return getClass().getName().compareTo(other.getClass().getName());
9970
      }
9971
 
9972
      int lastComparison = 0;
9973
      captureHdfcPayment_args typedOther = (captureHdfcPayment_args)other;
9974
 
9975
      lastComparison = Boolean.valueOf(isSetMerchantPaymentId()).compareTo(isSetMerchantPaymentId());
9976
      if (lastComparison != 0) {
9977
        return lastComparison;
9978
      }
9979
      lastComparison = TBaseHelper.compareTo(merchantPaymentId, typedOther.merchantPaymentId);
9980
      if (lastComparison != 0) {
9981
        return lastComparison;
9982
      }
9983
      return 0;
9984
    }
9985
 
9986
    public void read(TProtocol iprot) throws TException {
9987
      TField field;
9988
      iprot.readStructBegin();
9989
      while (true)
9990
      {
9991
        field = iprot.readFieldBegin();
9992
        if (field.type == TType.STOP) { 
9993
          break;
9994
        }
9995
        _Fields fieldId = _Fields.findByThriftId(field.id);
9996
        if (fieldId == null) {
9997
          TProtocolUtil.skip(iprot, field.type);
9998
        } else {
9999
          switch (fieldId) {
10000
            case MERCHANT_PAYMENT_ID:
10001
              if (field.type == TType.I64) {
10002
                this.merchantPaymentId = iprot.readI64();
10003
                setMerchantPaymentIdIsSet(true);
10004
              } else { 
10005
                TProtocolUtil.skip(iprot, field.type);
10006
              }
10007
              break;
10008
          }
10009
          iprot.readFieldEnd();
10010
        }
10011
      }
10012
      iprot.readStructEnd();
10013
      validate();
10014
    }
10015
 
10016
    public void write(TProtocol oprot) throws TException {
10017
      validate();
10018
 
10019
      oprot.writeStructBegin(STRUCT_DESC);
10020
      oprot.writeFieldBegin(MERCHANT_PAYMENT_ID_FIELD_DESC);
10021
      oprot.writeI64(this.merchantPaymentId);
10022
      oprot.writeFieldEnd();
10023
      oprot.writeFieldStop();
10024
      oprot.writeStructEnd();
10025
    }
10026
 
10027
    @Override
10028
    public String toString() {
10029
      StringBuilder sb = new StringBuilder("captureHdfcPayment_args(");
10030
      boolean first = true;
10031
 
10032
      sb.append("merchantPaymentId:");
10033
      sb.append(this.merchantPaymentId);
10034
      first = false;
10035
      sb.append(")");
10036
      return sb.toString();
10037
    }
10038
 
10039
    public void validate() throws TException {
10040
      // check for required fields
10041
    }
10042
 
10043
  }
10044
 
10045
  public static class captureHdfcPayment_result implements TBase<captureHdfcPayment_result._Fields>, java.io.Serializable, Cloneable   {
10046
    private static final TStruct STRUCT_DESC = new TStruct("captureHdfcPayment_result");
10047
 
10048
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.MAP, (short)0);
10049
    private static final TField PE_FIELD_DESC = new TField("pe", TType.STRUCT, (short)1);
10050
 
10051
    private Map<String,String> success;
10052
    private PaymentException pe;
10053
 
10054
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
10055
    public enum _Fields implements TFieldIdEnum {
10056
      SUCCESS((short)0, "success"),
10057
      PE((short)1, "pe");
10058
 
10059
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
10060
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
10061
 
10062
      static {
10063
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
10064
          byId.put((int)field._thriftId, field);
10065
          byName.put(field.getFieldName(), field);
10066
        }
10067
      }
10068
 
10069
      /**
10070
       * Find the _Fields constant that matches fieldId, or null if its not found.
10071
       */
10072
      public static _Fields findByThriftId(int fieldId) {
10073
        return byId.get(fieldId);
10074
      }
10075
 
10076
      /**
10077
       * Find the _Fields constant that matches fieldId, throwing an exception
10078
       * if it is not found.
10079
       */
10080
      public static _Fields findByThriftIdOrThrow(int fieldId) {
10081
        _Fields fields = findByThriftId(fieldId);
10082
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
10083
        return fields;
10084
      }
10085
 
10086
      /**
10087
       * Find the _Fields constant that matches name, or null if its not found.
10088
       */
10089
      public static _Fields findByName(String name) {
10090
        return byName.get(name);
10091
      }
10092
 
10093
      private final short _thriftId;
10094
      private final String _fieldName;
10095
 
10096
      _Fields(short thriftId, String fieldName) {
10097
        _thriftId = thriftId;
10098
        _fieldName = fieldName;
10099
      }
10100
 
10101
      public short getThriftFieldId() {
10102
        return _thriftId;
10103
      }
10104
 
10105
      public String getFieldName() {
10106
        return _fieldName;
10107
      }
10108
    }
10109
 
10110
    // isset id assignments
10111
 
10112
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
10113
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
10114
          new MapMetaData(TType.MAP, 
10115
              new FieldValueMetaData(TType.STRING), 
10116
              new FieldValueMetaData(TType.STRING))));
10117
      put(_Fields.PE, new FieldMetaData("pe", TFieldRequirementType.DEFAULT, 
10118
          new FieldValueMetaData(TType.STRUCT)));
10119
    }});
10120
 
10121
    static {
10122
      FieldMetaData.addStructMetaDataMap(captureHdfcPayment_result.class, metaDataMap);
10123
    }
10124
 
10125
    public captureHdfcPayment_result() {
10126
    }
10127
 
10128
    public captureHdfcPayment_result(
10129
      Map<String,String> success,
10130
      PaymentException pe)
10131
    {
10132
      this();
10133
      this.success = success;
10134
      this.pe = pe;
10135
    }
10136
 
10137
    /**
10138
     * Performs a deep copy on <i>other</i>.
10139
     */
10140
    public captureHdfcPayment_result(captureHdfcPayment_result other) {
10141
      if (other.isSetSuccess()) {
10142
        Map<String,String> __this__success = new HashMap<String,String>();
10143
        for (Map.Entry<String, String> other_element : other.success.entrySet()) {
10144
 
10145
          String other_element_key = other_element.getKey();
10146
          String other_element_value = other_element.getValue();
10147
 
10148
          String __this__success_copy_key = other_element_key;
10149
 
10150
          String __this__success_copy_value = other_element_value;
10151
 
10152
          __this__success.put(__this__success_copy_key, __this__success_copy_value);
10153
        }
10154
        this.success = __this__success;
10155
      }
10156
      if (other.isSetPe()) {
10157
        this.pe = new PaymentException(other.pe);
10158
      }
10159
    }
10160
 
10161
    public captureHdfcPayment_result deepCopy() {
10162
      return new captureHdfcPayment_result(this);
10163
    }
10164
 
10165
    @Deprecated
10166
    public captureHdfcPayment_result clone() {
10167
      return new captureHdfcPayment_result(this);
10168
    }
10169
 
10170
    public int getSuccessSize() {
10171
      return (this.success == null) ? 0 : this.success.size();
10172
    }
10173
 
10174
    public void putToSuccess(String key, String val) {
10175
      if (this.success == null) {
10176
        this.success = new HashMap<String,String>();
10177
      }
10178
      this.success.put(key, val);
10179
    }
10180
 
10181
    public Map<String,String> getSuccess() {
10182
      return this.success;
10183
    }
10184
 
10185
    public captureHdfcPayment_result setSuccess(Map<String,String> success) {
10186
      this.success = success;
10187
      return this;
10188
    }
10189
 
10190
    public void unsetSuccess() {
10191
      this.success = null;
10192
    }
10193
 
10194
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
10195
    public boolean isSetSuccess() {
10196
      return this.success != null;
10197
    }
10198
 
10199
    public void setSuccessIsSet(boolean value) {
10200
      if (!value) {
10201
        this.success = null;
10202
      }
10203
    }
10204
 
10205
    public PaymentException getPe() {
10206
      return this.pe;
10207
    }
10208
 
10209
    public captureHdfcPayment_result setPe(PaymentException pe) {
10210
      this.pe = pe;
10211
      return this;
10212
    }
10213
 
10214
    public void unsetPe() {
10215
      this.pe = null;
10216
    }
10217
 
10218
    /** Returns true if field pe is set (has been asigned a value) and false otherwise */
10219
    public boolean isSetPe() {
10220
      return this.pe != null;
10221
    }
10222
 
10223
    public void setPeIsSet(boolean value) {
10224
      if (!value) {
10225
        this.pe = null;
10226
      }
10227
    }
10228
 
10229
    public void setFieldValue(_Fields field, Object value) {
10230
      switch (field) {
10231
      case SUCCESS:
10232
        if (value == null) {
10233
          unsetSuccess();
10234
        } else {
10235
          setSuccess((Map<String,String>)value);
10236
        }
10237
        break;
10238
 
10239
      case PE:
10240
        if (value == null) {
10241
          unsetPe();
10242
        } else {
10243
          setPe((PaymentException)value);
10244
        }
10245
        break;
10246
 
10247
      }
10248
    }
10249
 
10250
    public void setFieldValue(int fieldID, Object value) {
10251
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
10252
    }
10253
 
10254
    public Object getFieldValue(_Fields field) {
10255
      switch (field) {
10256
      case SUCCESS:
10257
        return getSuccess();
10258
 
10259
      case PE:
10260
        return getPe();
10261
 
10262
      }
10263
      throw new IllegalStateException();
10264
    }
10265
 
10266
    public Object getFieldValue(int fieldId) {
10267
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
10268
    }
10269
 
10270
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
10271
    public boolean isSet(_Fields field) {
10272
      switch (field) {
10273
      case SUCCESS:
10274
        return isSetSuccess();
10275
      case PE:
10276
        return isSetPe();
10277
      }
10278
      throw new IllegalStateException();
10279
    }
10280
 
10281
    public boolean isSet(int fieldID) {
10282
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
10283
    }
10284
 
10285
    @Override
10286
    public boolean equals(Object that) {
10287
      if (that == null)
10288
        return false;
10289
      if (that instanceof captureHdfcPayment_result)
10290
        return this.equals((captureHdfcPayment_result)that);
10291
      return false;
10292
    }
10293
 
10294
    public boolean equals(captureHdfcPayment_result that) {
10295
      if (that == null)
10296
        return false;
10297
 
10298
      boolean this_present_success = true && this.isSetSuccess();
10299
      boolean that_present_success = true && that.isSetSuccess();
10300
      if (this_present_success || that_present_success) {
10301
        if (!(this_present_success && that_present_success))
10302
          return false;
10303
        if (!this.success.equals(that.success))
10304
          return false;
10305
      }
10306
 
10307
      boolean this_present_pe = true && this.isSetPe();
10308
      boolean that_present_pe = true && that.isSetPe();
10309
      if (this_present_pe || that_present_pe) {
10310
        if (!(this_present_pe && that_present_pe))
10311
          return false;
10312
        if (!this.pe.equals(that.pe))
10313
          return false;
10314
      }
10315
 
10316
      return true;
10317
    }
10318
 
10319
    @Override
10320
    public int hashCode() {
10321
      return 0;
10322
    }
10323
 
10324
    public void read(TProtocol iprot) throws TException {
10325
      TField field;
10326
      iprot.readStructBegin();
10327
      while (true)
10328
      {
10329
        field = iprot.readFieldBegin();
10330
        if (field.type == TType.STOP) { 
10331
          break;
10332
        }
10333
        _Fields fieldId = _Fields.findByThriftId(field.id);
10334
        if (fieldId == null) {
10335
          TProtocolUtil.skip(iprot, field.type);
10336
        } else {
10337
          switch (fieldId) {
10338
            case SUCCESS:
10339
              if (field.type == TType.MAP) {
10340
                {
2708 chandransh 10341
                  TMap _map38 = iprot.readMapBegin();
10342
                  this.success = new HashMap<String,String>(2*_map38.size);
10343
                  for (int _i39 = 0; _i39 < _map38.size; ++_i39)
2462 chandransh 10344
                  {
2708 chandransh 10345
                    String _key40;
10346
                    String _val41;
10347
                    _key40 = iprot.readString();
10348
                    _val41 = iprot.readString();
10349
                    this.success.put(_key40, _val41);
2462 chandransh 10350
                  }
10351
                  iprot.readMapEnd();
10352
                }
10353
              } else { 
10354
                TProtocolUtil.skip(iprot, field.type);
10355
              }
10356
              break;
10357
            case PE:
10358
              if (field.type == TType.STRUCT) {
10359
                this.pe = new PaymentException();
10360
                this.pe.read(iprot);
10361
              } else { 
10362
                TProtocolUtil.skip(iprot, field.type);
10363
              }
10364
              break;
10365
          }
10366
          iprot.readFieldEnd();
10367
        }
10368
      }
10369
      iprot.readStructEnd();
10370
      validate();
10371
    }
10372
 
10373
    public void write(TProtocol oprot) throws TException {
10374
      oprot.writeStructBegin(STRUCT_DESC);
10375
 
10376
      if (this.isSetSuccess()) {
10377
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
10378
        {
10379
          oprot.writeMapBegin(new TMap(TType.STRING, TType.STRING, this.success.size()));
2708 chandransh 10380
          for (Map.Entry<String, String> _iter42 : this.success.entrySet())
2462 chandransh 10381
          {
2708 chandransh 10382
            oprot.writeString(_iter42.getKey());
10383
            oprot.writeString(_iter42.getValue());
2462 chandransh 10384
          }
10385
          oprot.writeMapEnd();
10386
        }
10387
        oprot.writeFieldEnd();
10388
      } else if (this.isSetPe()) {
10389
        oprot.writeFieldBegin(PE_FIELD_DESC);
10390
        this.pe.write(oprot);
10391
        oprot.writeFieldEnd();
10392
      }
10393
      oprot.writeFieldStop();
10394
      oprot.writeStructEnd();
10395
    }
10396
 
10397
    @Override
10398
    public String toString() {
10399
      StringBuilder sb = new StringBuilder("captureHdfcPayment_result(");
10400
      boolean first = true;
10401
 
10402
      sb.append("success:");
10403
      if (this.success == null) {
10404
        sb.append("null");
10405
      } else {
10406
        sb.append(this.success);
10407
      }
10408
      first = false;
10409
      if (!first) sb.append(", ");
10410
      sb.append("pe:");
10411
      if (this.pe == null) {
10412
        sb.append("null");
10413
      } else {
10414
        sb.append(this.pe);
10415
      }
10416
      first = false;
10417
      sb.append(")");
10418
      return sb.toString();
10419
    }
10420
 
10421
    public void validate() throws TException {
10422
      // check for required fields
10423
    }
10424
 
10425
  }
10426
 
10427
  public static class initializeHdfcPayment_args implements TBase<initializeHdfcPayment_args._Fields>, java.io.Serializable, Cloneable, Comparable<initializeHdfcPayment_args>   {
10428
    private static final TStruct STRUCT_DESC = new TStruct("initializeHdfcPayment_args");
10429
 
10430
    private static final TField MERCHANT_PAYMENT_ID_FIELD_DESC = new TField("merchantPaymentId", TType.I64, (short)1);
10431
 
10432
    private long merchantPaymentId;
10433
 
10434
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
10435
    public enum _Fields implements TFieldIdEnum {
10436
      MERCHANT_PAYMENT_ID((short)1, "merchantPaymentId");
10437
 
10438
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
10439
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
10440
 
10441
      static {
10442
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
10443
          byId.put((int)field._thriftId, field);
10444
          byName.put(field.getFieldName(), field);
10445
        }
10446
      }
10447
 
10448
      /**
10449
       * Find the _Fields constant that matches fieldId, or null if its not found.
10450
       */
10451
      public static _Fields findByThriftId(int fieldId) {
10452
        return byId.get(fieldId);
10453
      }
10454
 
10455
      /**
10456
       * Find the _Fields constant that matches fieldId, throwing an exception
10457
       * if it is not found.
10458
       */
10459
      public static _Fields findByThriftIdOrThrow(int fieldId) {
10460
        _Fields fields = findByThriftId(fieldId);
10461
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
10462
        return fields;
10463
      }
10464
 
10465
      /**
10466
       * Find the _Fields constant that matches name, or null if its not found.
10467
       */
10468
      public static _Fields findByName(String name) {
10469
        return byName.get(name);
10470
      }
10471
 
10472
      private final short _thriftId;
10473
      private final String _fieldName;
10474
 
10475
      _Fields(short thriftId, String fieldName) {
10476
        _thriftId = thriftId;
10477
        _fieldName = fieldName;
10478
      }
10479
 
10480
      public short getThriftFieldId() {
10481
        return _thriftId;
10482
      }
10483
 
10484
      public String getFieldName() {
10485
        return _fieldName;
10486
      }
10487
    }
10488
 
10489
    // isset id assignments
10490
    private static final int __MERCHANTPAYMENTID_ISSET_ID = 0;
10491
    private BitSet __isset_bit_vector = new BitSet(1);
10492
 
10493
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
10494
      put(_Fields.MERCHANT_PAYMENT_ID, new FieldMetaData("merchantPaymentId", TFieldRequirementType.DEFAULT, 
10495
          new FieldValueMetaData(TType.I64)));
10496
    }});
10497
 
10498
    static {
10499
      FieldMetaData.addStructMetaDataMap(initializeHdfcPayment_args.class, metaDataMap);
10500
    }
10501
 
10502
    public initializeHdfcPayment_args() {
10503
    }
10504
 
10505
    public initializeHdfcPayment_args(
10506
      long merchantPaymentId)
10507
    {
10508
      this();
10509
      this.merchantPaymentId = merchantPaymentId;
10510
      setMerchantPaymentIdIsSet(true);
10511
    }
10512
 
10513
    /**
10514
     * Performs a deep copy on <i>other</i>.
10515
     */
10516
    public initializeHdfcPayment_args(initializeHdfcPayment_args other) {
10517
      __isset_bit_vector.clear();
10518
      __isset_bit_vector.or(other.__isset_bit_vector);
10519
      this.merchantPaymentId = other.merchantPaymentId;
10520
    }
10521
 
10522
    public initializeHdfcPayment_args deepCopy() {
10523
      return new initializeHdfcPayment_args(this);
10524
    }
10525
 
10526
    @Deprecated
10527
    public initializeHdfcPayment_args clone() {
10528
      return new initializeHdfcPayment_args(this);
10529
    }
10530
 
10531
    public long getMerchantPaymentId() {
10532
      return this.merchantPaymentId;
10533
    }
10534
 
10535
    public initializeHdfcPayment_args setMerchantPaymentId(long merchantPaymentId) {
10536
      this.merchantPaymentId = merchantPaymentId;
10537
      setMerchantPaymentIdIsSet(true);
10538
      return this;
10539
    }
10540
 
10541
    public void unsetMerchantPaymentId() {
10542
      __isset_bit_vector.clear(__MERCHANTPAYMENTID_ISSET_ID);
10543
    }
10544
 
10545
    /** Returns true if field merchantPaymentId is set (has been asigned a value) and false otherwise */
10546
    public boolean isSetMerchantPaymentId() {
10547
      return __isset_bit_vector.get(__MERCHANTPAYMENTID_ISSET_ID);
10548
    }
10549
 
10550
    public void setMerchantPaymentIdIsSet(boolean value) {
10551
      __isset_bit_vector.set(__MERCHANTPAYMENTID_ISSET_ID, value);
10552
    }
10553
 
10554
    public void setFieldValue(_Fields field, Object value) {
10555
      switch (field) {
10556
      case MERCHANT_PAYMENT_ID:
10557
        if (value == null) {
10558
          unsetMerchantPaymentId();
10559
        } else {
10560
          setMerchantPaymentId((Long)value);
10561
        }
10562
        break;
10563
 
10564
      }
10565
    }
10566
 
10567
    public void setFieldValue(int fieldID, Object value) {
10568
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
10569
    }
10570
 
10571
    public Object getFieldValue(_Fields field) {
10572
      switch (field) {
10573
      case MERCHANT_PAYMENT_ID:
10574
        return new Long(getMerchantPaymentId());
10575
 
10576
      }
10577
      throw new IllegalStateException();
10578
    }
10579
 
10580
    public Object getFieldValue(int fieldId) {
10581
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
10582
    }
10583
 
10584
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
10585
    public boolean isSet(_Fields field) {
10586
      switch (field) {
10587
      case MERCHANT_PAYMENT_ID:
10588
        return isSetMerchantPaymentId();
10589
      }
10590
      throw new IllegalStateException();
10591
    }
10592
 
10593
    public boolean isSet(int fieldID) {
10594
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
10595
    }
10596
 
10597
    @Override
10598
    public boolean equals(Object that) {
10599
      if (that == null)
10600
        return false;
10601
      if (that instanceof initializeHdfcPayment_args)
10602
        return this.equals((initializeHdfcPayment_args)that);
10603
      return false;
10604
    }
10605
 
10606
    public boolean equals(initializeHdfcPayment_args that) {
10607
      if (that == null)
10608
        return false;
10609
 
10610
      boolean this_present_merchantPaymentId = true;
10611
      boolean that_present_merchantPaymentId = true;
10612
      if (this_present_merchantPaymentId || that_present_merchantPaymentId) {
10613
        if (!(this_present_merchantPaymentId && that_present_merchantPaymentId))
10614
          return false;
10615
        if (this.merchantPaymentId != that.merchantPaymentId)
10616
          return false;
10617
      }
10618
 
10619
      return true;
10620
    }
10621
 
10622
    @Override
10623
    public int hashCode() {
10624
      return 0;
10625
    }
10626
 
10627
    public int compareTo(initializeHdfcPayment_args other) {
10628
      if (!getClass().equals(other.getClass())) {
10629
        return getClass().getName().compareTo(other.getClass().getName());
10630
      }
10631
 
10632
      int lastComparison = 0;
10633
      initializeHdfcPayment_args typedOther = (initializeHdfcPayment_args)other;
10634
 
10635
      lastComparison = Boolean.valueOf(isSetMerchantPaymentId()).compareTo(isSetMerchantPaymentId());
10636
      if (lastComparison != 0) {
10637
        return lastComparison;
10638
      }
10639
      lastComparison = TBaseHelper.compareTo(merchantPaymentId, typedOther.merchantPaymentId);
10640
      if (lastComparison != 0) {
10641
        return lastComparison;
10642
      }
10643
      return 0;
10644
    }
10645
 
10646
    public void read(TProtocol iprot) throws TException {
10647
      TField field;
10648
      iprot.readStructBegin();
10649
      while (true)
10650
      {
10651
        field = iprot.readFieldBegin();
10652
        if (field.type == TType.STOP) { 
10653
          break;
10654
        }
10655
        _Fields fieldId = _Fields.findByThriftId(field.id);
10656
        if (fieldId == null) {
10657
          TProtocolUtil.skip(iprot, field.type);
10658
        } else {
10659
          switch (fieldId) {
10660
            case MERCHANT_PAYMENT_ID:
10661
              if (field.type == TType.I64) {
10662
                this.merchantPaymentId = iprot.readI64();
10663
                setMerchantPaymentIdIsSet(true);
10664
              } else { 
10665
                TProtocolUtil.skip(iprot, field.type);
10666
              }
10667
              break;
10668
          }
10669
          iprot.readFieldEnd();
10670
        }
10671
      }
10672
      iprot.readStructEnd();
10673
      validate();
10674
    }
10675
 
10676
    public void write(TProtocol oprot) throws TException {
10677
      validate();
10678
 
10679
      oprot.writeStructBegin(STRUCT_DESC);
10680
      oprot.writeFieldBegin(MERCHANT_PAYMENT_ID_FIELD_DESC);
10681
      oprot.writeI64(this.merchantPaymentId);
10682
      oprot.writeFieldEnd();
10683
      oprot.writeFieldStop();
10684
      oprot.writeStructEnd();
10685
    }
10686
 
10687
    @Override
10688
    public String toString() {
10689
      StringBuilder sb = new StringBuilder("initializeHdfcPayment_args(");
10690
      boolean first = true;
10691
 
10692
      sb.append("merchantPaymentId:");
10693
      sb.append(this.merchantPaymentId);
10694
      first = false;
10695
      sb.append(")");
10696
      return sb.toString();
10697
    }
10698
 
10699
    public void validate() throws TException {
10700
      // check for required fields
10701
    }
10702
 
10703
  }
10704
 
10705
  public static class initializeHdfcPayment_result implements TBase<initializeHdfcPayment_result._Fields>, java.io.Serializable, Cloneable, Comparable<initializeHdfcPayment_result>   {
10706
    private static final TStruct STRUCT_DESC = new TStruct("initializeHdfcPayment_result");
10707
 
10708
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRING, (short)0);
10709
    private static final TField PE_FIELD_DESC = new TField("pe", TType.STRUCT, (short)1);
10710
 
10711
    private String success;
10712
    private PaymentException pe;
10713
 
10714
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
10715
    public enum _Fields implements TFieldIdEnum {
10716
      SUCCESS((short)0, "success"),
10717
      PE((short)1, "pe");
10718
 
10719
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
10720
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
10721
 
10722
      static {
10723
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
10724
          byId.put((int)field._thriftId, field);
10725
          byName.put(field.getFieldName(), field);
10726
        }
10727
      }
10728
 
10729
      /**
10730
       * Find the _Fields constant that matches fieldId, or null if its not found.
10731
       */
10732
      public static _Fields findByThriftId(int fieldId) {
10733
        return byId.get(fieldId);
10734
      }
10735
 
10736
      /**
10737
       * Find the _Fields constant that matches fieldId, throwing an exception
10738
       * if it is not found.
10739
       */
10740
      public static _Fields findByThriftIdOrThrow(int fieldId) {
10741
        _Fields fields = findByThriftId(fieldId);
10742
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
10743
        return fields;
10744
      }
10745
 
10746
      /**
10747
       * Find the _Fields constant that matches name, or null if its not found.
10748
       */
10749
      public static _Fields findByName(String name) {
10750
        return byName.get(name);
10751
      }
10752
 
10753
      private final short _thriftId;
10754
      private final String _fieldName;
10755
 
10756
      _Fields(short thriftId, String fieldName) {
10757
        _thriftId = thriftId;
10758
        _fieldName = fieldName;
10759
      }
10760
 
10761
      public short getThriftFieldId() {
10762
        return _thriftId;
10763
      }
10764
 
10765
      public String getFieldName() {
10766
        return _fieldName;
10767
      }
10768
    }
10769
 
10770
    // isset id assignments
10771
 
10772
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
10773
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
10774
          new FieldValueMetaData(TType.STRING)));
10775
      put(_Fields.PE, new FieldMetaData("pe", TFieldRequirementType.DEFAULT, 
10776
          new FieldValueMetaData(TType.STRUCT)));
10777
    }});
10778
 
10779
    static {
10780
      FieldMetaData.addStructMetaDataMap(initializeHdfcPayment_result.class, metaDataMap);
10781
    }
10782
 
10783
    public initializeHdfcPayment_result() {
10784
    }
10785
 
10786
    public initializeHdfcPayment_result(
10787
      String success,
10788
      PaymentException pe)
10789
    {
10790
      this();
10791
      this.success = success;
10792
      this.pe = pe;
10793
    }
10794
 
10795
    /**
10796
     * Performs a deep copy on <i>other</i>.
10797
     */
10798
    public initializeHdfcPayment_result(initializeHdfcPayment_result other) {
10799
      if (other.isSetSuccess()) {
10800
        this.success = other.success;
10801
      }
10802
      if (other.isSetPe()) {
10803
        this.pe = new PaymentException(other.pe);
10804
      }
10805
    }
10806
 
10807
    public initializeHdfcPayment_result deepCopy() {
10808
      return new initializeHdfcPayment_result(this);
10809
    }
10810
 
10811
    @Deprecated
10812
    public initializeHdfcPayment_result clone() {
10813
      return new initializeHdfcPayment_result(this);
10814
    }
10815
 
10816
    public String getSuccess() {
10817
      return this.success;
10818
    }
10819
 
10820
    public initializeHdfcPayment_result setSuccess(String success) {
10821
      this.success = success;
10822
      return this;
10823
    }
10824
 
10825
    public void unsetSuccess() {
10826
      this.success = null;
10827
    }
10828
 
10829
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
10830
    public boolean isSetSuccess() {
10831
      return this.success != null;
10832
    }
10833
 
10834
    public void setSuccessIsSet(boolean value) {
10835
      if (!value) {
10836
        this.success = null;
10837
      }
10838
    }
10839
 
10840
    public PaymentException getPe() {
10841
      return this.pe;
10842
    }
10843
 
10844
    public initializeHdfcPayment_result setPe(PaymentException pe) {
10845
      this.pe = pe;
10846
      return this;
10847
    }
10848
 
10849
    public void unsetPe() {
10850
      this.pe = null;
10851
    }
10852
 
10853
    /** Returns true if field pe is set (has been asigned a value) and false otherwise */
10854
    public boolean isSetPe() {
10855
      return this.pe != null;
10856
    }
10857
 
10858
    public void setPeIsSet(boolean value) {
10859
      if (!value) {
10860
        this.pe = null;
10861
      }
10862
    }
10863
 
10864
    public void setFieldValue(_Fields field, Object value) {
10865
      switch (field) {
10866
      case SUCCESS:
10867
        if (value == null) {
10868
          unsetSuccess();
10869
        } else {
10870
          setSuccess((String)value);
10871
        }
10872
        break;
10873
 
10874
      case PE:
10875
        if (value == null) {
10876
          unsetPe();
10877
        } else {
10878
          setPe((PaymentException)value);
10879
        }
10880
        break;
10881
 
10882
      }
10883
    }
10884
 
10885
    public void setFieldValue(int fieldID, Object value) {
10886
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
10887
    }
10888
 
10889
    public Object getFieldValue(_Fields field) {
10890
      switch (field) {
10891
      case SUCCESS:
10892
        return getSuccess();
10893
 
10894
      case PE:
10895
        return getPe();
10896
 
10897
      }
10898
      throw new IllegalStateException();
10899
    }
10900
 
10901
    public Object getFieldValue(int fieldId) {
10902
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
10903
    }
10904
 
10905
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
10906
    public boolean isSet(_Fields field) {
10907
      switch (field) {
10908
      case SUCCESS:
10909
        return isSetSuccess();
10910
      case PE:
10911
        return isSetPe();
10912
      }
10913
      throw new IllegalStateException();
10914
    }
10915
 
10916
    public boolean isSet(int fieldID) {
10917
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
10918
    }
10919
 
10920
    @Override
10921
    public boolean equals(Object that) {
10922
      if (that == null)
10923
        return false;
10924
      if (that instanceof initializeHdfcPayment_result)
10925
        return this.equals((initializeHdfcPayment_result)that);
10926
      return false;
10927
    }
10928
 
10929
    public boolean equals(initializeHdfcPayment_result that) {
10930
      if (that == null)
10931
        return false;
10932
 
10933
      boolean this_present_success = true && this.isSetSuccess();
10934
      boolean that_present_success = true && that.isSetSuccess();
10935
      if (this_present_success || that_present_success) {
10936
        if (!(this_present_success && that_present_success))
10937
          return false;
10938
        if (!this.success.equals(that.success))
10939
          return false;
10940
      }
10941
 
10942
      boolean this_present_pe = true && this.isSetPe();
10943
      boolean that_present_pe = true && that.isSetPe();
10944
      if (this_present_pe || that_present_pe) {
10945
        if (!(this_present_pe && that_present_pe))
10946
          return false;
10947
        if (!this.pe.equals(that.pe))
10948
          return false;
10949
      }
10950
 
10951
      return true;
10952
    }
10953
 
10954
    @Override
10955
    public int hashCode() {
10956
      return 0;
10957
    }
10958
 
10959
    public int compareTo(initializeHdfcPayment_result other) {
10960
      if (!getClass().equals(other.getClass())) {
10961
        return getClass().getName().compareTo(other.getClass().getName());
10962
      }
10963
 
10964
      int lastComparison = 0;
10965
      initializeHdfcPayment_result typedOther = (initializeHdfcPayment_result)other;
10966
 
10967
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
10968
      if (lastComparison != 0) {
10969
        return lastComparison;
10970
      }
10971
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
10972
      if (lastComparison != 0) {
10973
        return lastComparison;
10974
      }
10975
      lastComparison = Boolean.valueOf(isSetPe()).compareTo(isSetPe());
10976
      if (lastComparison != 0) {
10977
        return lastComparison;
10978
      }
10979
      lastComparison = TBaseHelper.compareTo(pe, typedOther.pe);
10980
      if (lastComparison != 0) {
10981
        return lastComparison;
10982
      }
10983
      return 0;
10984
    }
10985
 
10986
    public void read(TProtocol iprot) throws TException {
10987
      TField field;
10988
      iprot.readStructBegin();
10989
      while (true)
10990
      {
10991
        field = iprot.readFieldBegin();
10992
        if (field.type == TType.STOP) { 
10993
          break;
10994
        }
10995
        _Fields fieldId = _Fields.findByThriftId(field.id);
10996
        if (fieldId == null) {
10997
          TProtocolUtil.skip(iprot, field.type);
10998
        } else {
10999
          switch (fieldId) {
11000
            case SUCCESS:
11001
              if (field.type == TType.STRING) {
11002
                this.success = iprot.readString();
11003
              } else { 
11004
                TProtocolUtil.skip(iprot, field.type);
11005
              }
11006
              break;
11007
            case PE:
11008
              if (field.type == TType.STRUCT) {
11009
                this.pe = new PaymentException();
11010
                this.pe.read(iprot);
11011
              } else { 
11012
                TProtocolUtil.skip(iprot, field.type);
11013
              }
11014
              break;
11015
          }
11016
          iprot.readFieldEnd();
11017
        }
11018
      }
11019
      iprot.readStructEnd();
11020
      validate();
11021
    }
11022
 
11023
    public void write(TProtocol oprot) throws TException {
11024
      oprot.writeStructBegin(STRUCT_DESC);
11025
 
11026
      if (this.isSetSuccess()) {
11027
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
11028
        oprot.writeString(this.success);
11029
        oprot.writeFieldEnd();
11030
      } else if (this.isSetPe()) {
11031
        oprot.writeFieldBegin(PE_FIELD_DESC);
11032
        this.pe.write(oprot);
11033
        oprot.writeFieldEnd();
11034
      }
11035
      oprot.writeFieldStop();
11036
      oprot.writeStructEnd();
11037
    }
11038
 
11039
    @Override
11040
    public String toString() {
11041
      StringBuilder sb = new StringBuilder("initializeHdfcPayment_result(");
11042
      boolean first = true;
11043
 
11044
      sb.append("success:");
11045
      if (this.success == null) {
11046
        sb.append("null");
11047
      } else {
11048
        sb.append(this.success);
11049
      }
11050
      first = false;
11051
      if (!first) sb.append(", ");
11052
      sb.append("pe:");
11053
      if (this.pe == null) {
11054
        sb.append("null");
11055
      } else {
11056
        sb.append(this.pe);
11057
      }
11058
      first = false;
11059
      sb.append(")");
11060
      return sb.toString();
11061
    }
11062
 
11063
    public void validate() throws TException {
11064
      // check for required fields
11065
    }
11066
 
11067
  }
11068
 
2690 chandransh 11069
  public static class createRefund_args implements TBase<createRefund_args._Fields>, java.io.Serializable, Cloneable, Comparable<createRefund_args>   {
11070
    private static final TStruct STRUCT_DESC = new TStruct("createRefund_args");
11071
 
11072
    private static final TField ORDER_ID_FIELD_DESC = new TField("orderId", TType.I64, (short)1);
11073
    private static final TField MERCHANT_TXN_ID_FIELD_DESC = new TField("merchantTxnId", TType.I64, (short)2);
11074
    private static final TField AMOUNT_FIELD_DESC = new TField("amount", TType.DOUBLE, (short)3);
11075
 
11076
    private long orderId;
11077
    private long merchantTxnId;
11078
    private double amount;
11079
 
11080
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
11081
    public enum _Fields implements TFieldIdEnum {
11082
      ORDER_ID((short)1, "orderId"),
11083
      MERCHANT_TXN_ID((short)2, "merchantTxnId"),
11084
      AMOUNT((short)3, "amount");
11085
 
11086
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
11087
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
11088
 
11089
      static {
11090
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
11091
          byId.put((int)field._thriftId, field);
11092
          byName.put(field.getFieldName(), field);
11093
        }
11094
      }
11095
 
11096
      /**
11097
       * Find the _Fields constant that matches fieldId, or null if its not found.
11098
       */
11099
      public static _Fields findByThriftId(int fieldId) {
11100
        return byId.get(fieldId);
11101
      }
11102
 
11103
      /**
11104
       * Find the _Fields constant that matches fieldId, throwing an exception
11105
       * if it is not found.
11106
       */
11107
      public static _Fields findByThriftIdOrThrow(int fieldId) {
11108
        _Fields fields = findByThriftId(fieldId);
11109
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
11110
        return fields;
11111
      }
11112
 
11113
      /**
11114
       * Find the _Fields constant that matches name, or null if its not found.
11115
       */
11116
      public static _Fields findByName(String name) {
11117
        return byName.get(name);
11118
      }
11119
 
11120
      private final short _thriftId;
11121
      private final String _fieldName;
11122
 
11123
      _Fields(short thriftId, String fieldName) {
11124
        _thriftId = thriftId;
11125
        _fieldName = fieldName;
11126
      }
11127
 
11128
      public short getThriftFieldId() {
11129
        return _thriftId;
11130
      }
11131
 
11132
      public String getFieldName() {
11133
        return _fieldName;
11134
      }
11135
    }
11136
 
11137
    // isset id assignments
11138
    private static final int __ORDERID_ISSET_ID = 0;
11139
    private static final int __MERCHANTTXNID_ISSET_ID = 1;
11140
    private static final int __AMOUNT_ISSET_ID = 2;
11141
    private BitSet __isset_bit_vector = new BitSet(3);
11142
 
11143
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
11144
      put(_Fields.ORDER_ID, new FieldMetaData("orderId", TFieldRequirementType.DEFAULT, 
11145
          new FieldValueMetaData(TType.I64)));
11146
      put(_Fields.MERCHANT_TXN_ID, new FieldMetaData("merchantTxnId", TFieldRequirementType.DEFAULT, 
11147
          new FieldValueMetaData(TType.I64)));
11148
      put(_Fields.AMOUNT, new FieldMetaData("amount", TFieldRequirementType.DEFAULT, 
11149
          new FieldValueMetaData(TType.DOUBLE)));
11150
    }});
11151
 
11152
    static {
11153
      FieldMetaData.addStructMetaDataMap(createRefund_args.class, metaDataMap);
11154
    }
11155
 
11156
    public createRefund_args() {
11157
    }
11158
 
11159
    public createRefund_args(
11160
      long orderId,
11161
      long merchantTxnId,
11162
      double amount)
11163
    {
11164
      this();
11165
      this.orderId = orderId;
11166
      setOrderIdIsSet(true);
11167
      this.merchantTxnId = merchantTxnId;
11168
      setMerchantTxnIdIsSet(true);
11169
      this.amount = amount;
11170
      setAmountIsSet(true);
11171
    }
11172
 
11173
    /**
11174
     * Performs a deep copy on <i>other</i>.
11175
     */
11176
    public createRefund_args(createRefund_args other) {
11177
      __isset_bit_vector.clear();
11178
      __isset_bit_vector.or(other.__isset_bit_vector);
11179
      this.orderId = other.orderId;
11180
      this.merchantTxnId = other.merchantTxnId;
11181
      this.amount = other.amount;
11182
    }
11183
 
11184
    public createRefund_args deepCopy() {
11185
      return new createRefund_args(this);
11186
    }
11187
 
11188
    @Deprecated
11189
    public createRefund_args clone() {
11190
      return new createRefund_args(this);
11191
    }
11192
 
11193
    public long getOrderId() {
11194
      return this.orderId;
11195
    }
11196
 
11197
    public createRefund_args setOrderId(long orderId) {
11198
      this.orderId = orderId;
11199
      setOrderIdIsSet(true);
11200
      return this;
11201
    }
11202
 
11203
    public void unsetOrderId() {
11204
      __isset_bit_vector.clear(__ORDERID_ISSET_ID);
11205
    }
11206
 
11207
    /** Returns true if field orderId is set (has been asigned a value) and false otherwise */
11208
    public boolean isSetOrderId() {
11209
      return __isset_bit_vector.get(__ORDERID_ISSET_ID);
11210
    }
11211
 
11212
    public void setOrderIdIsSet(boolean value) {
11213
      __isset_bit_vector.set(__ORDERID_ISSET_ID, value);
11214
    }
11215
 
11216
    public long getMerchantTxnId() {
11217
      return this.merchantTxnId;
11218
    }
11219
 
11220
    public createRefund_args setMerchantTxnId(long merchantTxnId) {
11221
      this.merchantTxnId = merchantTxnId;
11222
      setMerchantTxnIdIsSet(true);
11223
      return this;
11224
    }
11225
 
11226
    public void unsetMerchantTxnId() {
11227
      __isset_bit_vector.clear(__MERCHANTTXNID_ISSET_ID);
11228
    }
11229
 
11230
    /** Returns true if field merchantTxnId is set (has been asigned a value) and false otherwise */
11231
    public boolean isSetMerchantTxnId() {
11232
      return __isset_bit_vector.get(__MERCHANTTXNID_ISSET_ID);
11233
    }
11234
 
11235
    public void setMerchantTxnIdIsSet(boolean value) {
11236
      __isset_bit_vector.set(__MERCHANTTXNID_ISSET_ID, value);
11237
    }
11238
 
11239
    public double getAmount() {
11240
      return this.amount;
11241
    }
11242
 
11243
    public createRefund_args setAmount(double amount) {
11244
      this.amount = amount;
11245
      setAmountIsSet(true);
11246
      return this;
11247
    }
11248
 
11249
    public void unsetAmount() {
11250
      __isset_bit_vector.clear(__AMOUNT_ISSET_ID);
11251
    }
11252
 
11253
    /** Returns true if field amount is set (has been asigned a value) and false otherwise */
11254
    public boolean isSetAmount() {
11255
      return __isset_bit_vector.get(__AMOUNT_ISSET_ID);
11256
    }
11257
 
11258
    public void setAmountIsSet(boolean value) {
11259
      __isset_bit_vector.set(__AMOUNT_ISSET_ID, value);
11260
    }
11261
 
11262
    public void setFieldValue(_Fields field, Object value) {
11263
      switch (field) {
11264
      case ORDER_ID:
11265
        if (value == null) {
11266
          unsetOrderId();
11267
        } else {
11268
          setOrderId((Long)value);
11269
        }
11270
        break;
11271
 
11272
      case MERCHANT_TXN_ID:
11273
        if (value == null) {
11274
          unsetMerchantTxnId();
11275
        } else {
11276
          setMerchantTxnId((Long)value);
11277
        }
11278
        break;
11279
 
11280
      case AMOUNT:
11281
        if (value == null) {
11282
          unsetAmount();
11283
        } else {
11284
          setAmount((Double)value);
11285
        }
11286
        break;
11287
 
11288
      }
11289
    }
11290
 
11291
    public void setFieldValue(int fieldID, Object value) {
11292
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
11293
    }
11294
 
11295
    public Object getFieldValue(_Fields field) {
11296
      switch (field) {
11297
      case ORDER_ID:
11298
        return new Long(getOrderId());
11299
 
11300
      case MERCHANT_TXN_ID:
11301
        return new Long(getMerchantTxnId());
11302
 
11303
      case AMOUNT:
11304
        return new Double(getAmount());
11305
 
11306
      }
11307
      throw new IllegalStateException();
11308
    }
11309
 
11310
    public Object getFieldValue(int fieldId) {
11311
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
11312
    }
11313
 
11314
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
11315
    public boolean isSet(_Fields field) {
11316
      switch (field) {
11317
      case ORDER_ID:
11318
        return isSetOrderId();
11319
      case MERCHANT_TXN_ID:
11320
        return isSetMerchantTxnId();
11321
      case AMOUNT:
11322
        return isSetAmount();
11323
      }
11324
      throw new IllegalStateException();
11325
    }
11326
 
11327
    public boolean isSet(int fieldID) {
11328
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
11329
    }
11330
 
11331
    @Override
11332
    public boolean equals(Object that) {
11333
      if (that == null)
11334
        return false;
11335
      if (that instanceof createRefund_args)
11336
        return this.equals((createRefund_args)that);
11337
      return false;
11338
    }
11339
 
11340
    public boolean equals(createRefund_args that) {
11341
      if (that == null)
11342
        return false;
11343
 
11344
      boolean this_present_orderId = true;
11345
      boolean that_present_orderId = true;
11346
      if (this_present_orderId || that_present_orderId) {
11347
        if (!(this_present_orderId && that_present_orderId))
11348
          return false;
11349
        if (this.orderId != that.orderId)
11350
          return false;
11351
      }
11352
 
11353
      boolean this_present_merchantTxnId = true;
11354
      boolean that_present_merchantTxnId = true;
11355
      if (this_present_merchantTxnId || that_present_merchantTxnId) {
11356
        if (!(this_present_merchantTxnId && that_present_merchantTxnId))
11357
          return false;
11358
        if (this.merchantTxnId != that.merchantTxnId)
11359
          return false;
11360
      }
11361
 
11362
      boolean this_present_amount = true;
11363
      boolean that_present_amount = true;
11364
      if (this_present_amount || that_present_amount) {
11365
        if (!(this_present_amount && that_present_amount))
11366
          return false;
11367
        if (this.amount != that.amount)
11368
          return false;
11369
      }
11370
 
11371
      return true;
11372
    }
11373
 
11374
    @Override
11375
    public int hashCode() {
11376
      return 0;
11377
    }
11378
 
11379
    public int compareTo(createRefund_args other) {
11380
      if (!getClass().equals(other.getClass())) {
11381
        return getClass().getName().compareTo(other.getClass().getName());
11382
      }
11383
 
11384
      int lastComparison = 0;
11385
      createRefund_args typedOther = (createRefund_args)other;
11386
 
11387
      lastComparison = Boolean.valueOf(isSetOrderId()).compareTo(isSetOrderId());
11388
      if (lastComparison != 0) {
11389
        return lastComparison;
11390
      }
11391
      lastComparison = TBaseHelper.compareTo(orderId, typedOther.orderId);
11392
      if (lastComparison != 0) {
11393
        return lastComparison;
11394
      }
11395
      lastComparison = Boolean.valueOf(isSetMerchantTxnId()).compareTo(isSetMerchantTxnId());
11396
      if (lastComparison != 0) {
11397
        return lastComparison;
11398
      }
11399
      lastComparison = TBaseHelper.compareTo(merchantTxnId, typedOther.merchantTxnId);
11400
      if (lastComparison != 0) {
11401
        return lastComparison;
11402
      }
11403
      lastComparison = Boolean.valueOf(isSetAmount()).compareTo(isSetAmount());
11404
      if (lastComparison != 0) {
11405
        return lastComparison;
11406
      }
11407
      lastComparison = TBaseHelper.compareTo(amount, typedOther.amount);
11408
      if (lastComparison != 0) {
11409
        return lastComparison;
11410
      }
11411
      return 0;
11412
    }
11413
 
11414
    public void read(TProtocol iprot) throws TException {
11415
      TField field;
11416
      iprot.readStructBegin();
11417
      while (true)
11418
      {
11419
        field = iprot.readFieldBegin();
11420
        if (field.type == TType.STOP) { 
11421
          break;
11422
        }
11423
        _Fields fieldId = _Fields.findByThriftId(field.id);
11424
        if (fieldId == null) {
11425
          TProtocolUtil.skip(iprot, field.type);
11426
        } else {
11427
          switch (fieldId) {
11428
            case ORDER_ID:
11429
              if (field.type == TType.I64) {
11430
                this.orderId = iprot.readI64();
11431
                setOrderIdIsSet(true);
11432
              } else { 
11433
                TProtocolUtil.skip(iprot, field.type);
11434
              }
11435
              break;
11436
            case MERCHANT_TXN_ID:
11437
              if (field.type == TType.I64) {
11438
                this.merchantTxnId = iprot.readI64();
11439
                setMerchantTxnIdIsSet(true);
11440
              } else { 
11441
                TProtocolUtil.skip(iprot, field.type);
11442
              }
11443
              break;
11444
            case AMOUNT:
11445
              if (field.type == TType.DOUBLE) {
11446
                this.amount = iprot.readDouble();
11447
                setAmountIsSet(true);
11448
              } else { 
11449
                TProtocolUtil.skip(iprot, field.type);
11450
              }
11451
              break;
11452
          }
11453
          iprot.readFieldEnd();
11454
        }
11455
      }
11456
      iprot.readStructEnd();
11457
      validate();
11458
    }
11459
 
11460
    public void write(TProtocol oprot) throws TException {
11461
      validate();
11462
 
11463
      oprot.writeStructBegin(STRUCT_DESC);
11464
      oprot.writeFieldBegin(ORDER_ID_FIELD_DESC);
11465
      oprot.writeI64(this.orderId);
11466
      oprot.writeFieldEnd();
11467
      oprot.writeFieldBegin(MERCHANT_TXN_ID_FIELD_DESC);
11468
      oprot.writeI64(this.merchantTxnId);
11469
      oprot.writeFieldEnd();
11470
      oprot.writeFieldBegin(AMOUNT_FIELD_DESC);
11471
      oprot.writeDouble(this.amount);
11472
      oprot.writeFieldEnd();
11473
      oprot.writeFieldStop();
11474
      oprot.writeStructEnd();
11475
    }
11476
 
11477
    @Override
11478
    public String toString() {
11479
      StringBuilder sb = new StringBuilder("createRefund_args(");
11480
      boolean first = true;
11481
 
11482
      sb.append("orderId:");
11483
      sb.append(this.orderId);
11484
      first = false;
11485
      if (!first) sb.append(", ");
11486
      sb.append("merchantTxnId:");
11487
      sb.append(this.merchantTxnId);
11488
      first = false;
11489
      if (!first) sb.append(", ");
11490
      sb.append("amount:");
11491
      sb.append(this.amount);
11492
      first = false;
11493
      sb.append(")");
11494
      return sb.toString();
11495
    }
11496
 
11497
    public void validate() throws TException {
11498
      // check for required fields
11499
    }
11500
 
11501
  }
11502
 
11503
  public static class createRefund_result implements TBase<createRefund_result._Fields>, java.io.Serializable, Cloneable, Comparable<createRefund_result>   {
11504
    private static final TStruct STRUCT_DESC = new TStruct("createRefund_result");
11505
 
11506
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.I64, (short)0);
11507
    private static final TField PE_FIELD_DESC = new TField("pe", TType.STRUCT, (short)1);
11508
 
11509
    private long success;
11510
    private PaymentException pe;
11511
 
11512
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
11513
    public enum _Fields implements TFieldIdEnum {
11514
      SUCCESS((short)0, "success"),
11515
      PE((short)1, "pe");
11516
 
11517
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
11518
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
11519
 
11520
      static {
11521
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
11522
          byId.put((int)field._thriftId, field);
11523
          byName.put(field.getFieldName(), field);
11524
        }
11525
      }
11526
 
11527
      /**
11528
       * Find the _Fields constant that matches fieldId, or null if its not found.
11529
       */
11530
      public static _Fields findByThriftId(int fieldId) {
11531
        return byId.get(fieldId);
11532
      }
11533
 
11534
      /**
11535
       * Find the _Fields constant that matches fieldId, throwing an exception
11536
       * if it is not found.
11537
       */
11538
      public static _Fields findByThriftIdOrThrow(int fieldId) {
11539
        _Fields fields = findByThriftId(fieldId);
11540
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
11541
        return fields;
11542
      }
11543
 
11544
      /**
11545
       * Find the _Fields constant that matches name, or null if its not found.
11546
       */
11547
      public static _Fields findByName(String name) {
11548
        return byName.get(name);
11549
      }
11550
 
11551
      private final short _thriftId;
11552
      private final String _fieldName;
11553
 
11554
      _Fields(short thriftId, String fieldName) {
11555
        _thriftId = thriftId;
11556
        _fieldName = fieldName;
11557
      }
11558
 
11559
      public short getThriftFieldId() {
11560
        return _thriftId;
11561
      }
11562
 
11563
      public String getFieldName() {
11564
        return _fieldName;
11565
      }
11566
    }
11567
 
11568
    // isset id assignments
11569
    private static final int __SUCCESS_ISSET_ID = 0;
11570
    private BitSet __isset_bit_vector = new BitSet(1);
11571
 
11572
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
11573
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
11574
          new FieldValueMetaData(TType.I64)));
11575
      put(_Fields.PE, new FieldMetaData("pe", TFieldRequirementType.DEFAULT, 
11576
          new FieldValueMetaData(TType.STRUCT)));
11577
    }});
11578
 
11579
    static {
11580
      FieldMetaData.addStructMetaDataMap(createRefund_result.class, metaDataMap);
11581
    }
11582
 
11583
    public createRefund_result() {
11584
    }
11585
 
11586
    public createRefund_result(
11587
      long success,
11588
      PaymentException pe)
11589
    {
11590
      this();
11591
      this.success = success;
11592
      setSuccessIsSet(true);
11593
      this.pe = pe;
11594
    }
11595
 
11596
    /**
11597
     * Performs a deep copy on <i>other</i>.
11598
     */
11599
    public createRefund_result(createRefund_result other) {
11600
      __isset_bit_vector.clear();
11601
      __isset_bit_vector.or(other.__isset_bit_vector);
11602
      this.success = other.success;
11603
      if (other.isSetPe()) {
11604
        this.pe = new PaymentException(other.pe);
11605
      }
11606
    }
11607
 
11608
    public createRefund_result deepCopy() {
11609
      return new createRefund_result(this);
11610
    }
11611
 
11612
    @Deprecated
11613
    public createRefund_result clone() {
11614
      return new createRefund_result(this);
11615
    }
11616
 
11617
    public long getSuccess() {
11618
      return this.success;
11619
    }
11620
 
11621
    public createRefund_result setSuccess(long success) {
11622
      this.success = success;
11623
      setSuccessIsSet(true);
11624
      return this;
11625
    }
11626
 
11627
    public void unsetSuccess() {
11628
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
11629
    }
11630
 
11631
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
11632
    public boolean isSetSuccess() {
11633
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
11634
    }
11635
 
11636
    public void setSuccessIsSet(boolean value) {
11637
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
11638
    }
11639
 
11640
    public PaymentException getPe() {
11641
      return this.pe;
11642
    }
11643
 
11644
    public createRefund_result setPe(PaymentException pe) {
11645
      this.pe = pe;
11646
      return this;
11647
    }
11648
 
11649
    public void unsetPe() {
11650
      this.pe = null;
11651
    }
11652
 
11653
    /** Returns true if field pe is set (has been asigned a value) and false otherwise */
11654
    public boolean isSetPe() {
11655
      return this.pe != null;
11656
    }
11657
 
11658
    public void setPeIsSet(boolean value) {
11659
      if (!value) {
11660
        this.pe = null;
11661
      }
11662
    }
11663
 
11664
    public void setFieldValue(_Fields field, Object value) {
11665
      switch (field) {
11666
      case SUCCESS:
11667
        if (value == null) {
11668
          unsetSuccess();
11669
        } else {
11670
          setSuccess((Long)value);
11671
        }
11672
        break;
11673
 
11674
      case PE:
11675
        if (value == null) {
11676
          unsetPe();
11677
        } else {
11678
          setPe((PaymentException)value);
11679
        }
11680
        break;
11681
 
11682
      }
11683
    }
11684
 
11685
    public void setFieldValue(int fieldID, Object value) {
11686
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
11687
    }
11688
 
11689
    public Object getFieldValue(_Fields field) {
11690
      switch (field) {
11691
      case SUCCESS:
11692
        return new Long(getSuccess());
11693
 
11694
      case PE:
11695
        return getPe();
11696
 
11697
      }
11698
      throw new IllegalStateException();
11699
    }
11700
 
11701
    public Object getFieldValue(int fieldId) {
11702
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
11703
    }
11704
 
11705
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
11706
    public boolean isSet(_Fields field) {
11707
      switch (field) {
11708
      case SUCCESS:
11709
        return isSetSuccess();
11710
      case PE:
11711
        return isSetPe();
11712
      }
11713
      throw new IllegalStateException();
11714
    }
11715
 
11716
    public boolean isSet(int fieldID) {
11717
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
11718
    }
11719
 
11720
    @Override
11721
    public boolean equals(Object that) {
11722
      if (that == null)
11723
        return false;
11724
      if (that instanceof createRefund_result)
11725
        return this.equals((createRefund_result)that);
11726
      return false;
11727
    }
11728
 
11729
    public boolean equals(createRefund_result that) {
11730
      if (that == null)
11731
        return false;
11732
 
11733
      boolean this_present_success = true;
11734
      boolean that_present_success = true;
11735
      if (this_present_success || that_present_success) {
11736
        if (!(this_present_success && that_present_success))
11737
          return false;
11738
        if (this.success != that.success)
11739
          return false;
11740
      }
11741
 
11742
      boolean this_present_pe = true && this.isSetPe();
11743
      boolean that_present_pe = true && that.isSetPe();
11744
      if (this_present_pe || that_present_pe) {
11745
        if (!(this_present_pe && that_present_pe))
11746
          return false;
11747
        if (!this.pe.equals(that.pe))
11748
          return false;
11749
      }
11750
 
11751
      return true;
11752
    }
11753
 
11754
    @Override
11755
    public int hashCode() {
11756
      return 0;
11757
    }
11758
 
11759
    public int compareTo(createRefund_result other) {
11760
      if (!getClass().equals(other.getClass())) {
11761
        return getClass().getName().compareTo(other.getClass().getName());
11762
      }
11763
 
11764
      int lastComparison = 0;
11765
      createRefund_result typedOther = (createRefund_result)other;
11766
 
11767
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
11768
      if (lastComparison != 0) {
11769
        return lastComparison;
11770
      }
11771
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
11772
      if (lastComparison != 0) {
11773
        return lastComparison;
11774
      }
11775
      lastComparison = Boolean.valueOf(isSetPe()).compareTo(isSetPe());
11776
      if (lastComparison != 0) {
11777
        return lastComparison;
11778
      }
11779
      lastComparison = TBaseHelper.compareTo(pe, typedOther.pe);
11780
      if (lastComparison != 0) {
11781
        return lastComparison;
11782
      }
11783
      return 0;
11784
    }
11785
 
11786
    public void read(TProtocol iprot) throws TException {
11787
      TField field;
11788
      iprot.readStructBegin();
11789
      while (true)
11790
      {
11791
        field = iprot.readFieldBegin();
11792
        if (field.type == TType.STOP) { 
11793
          break;
11794
        }
11795
        _Fields fieldId = _Fields.findByThriftId(field.id);
11796
        if (fieldId == null) {
11797
          TProtocolUtil.skip(iprot, field.type);
11798
        } else {
11799
          switch (fieldId) {
11800
            case SUCCESS:
11801
              if (field.type == TType.I64) {
11802
                this.success = iprot.readI64();
11803
                setSuccessIsSet(true);
11804
              } else { 
11805
                TProtocolUtil.skip(iprot, field.type);
11806
              }
11807
              break;
11808
            case PE:
11809
              if (field.type == TType.STRUCT) {
11810
                this.pe = new PaymentException();
11811
                this.pe.read(iprot);
11812
              } else { 
11813
                TProtocolUtil.skip(iprot, field.type);
11814
              }
11815
              break;
11816
          }
11817
          iprot.readFieldEnd();
11818
        }
11819
      }
11820
      iprot.readStructEnd();
11821
      validate();
11822
    }
11823
 
11824
    public void write(TProtocol oprot) throws TException {
11825
      oprot.writeStructBegin(STRUCT_DESC);
11826
 
11827
      if (this.isSetSuccess()) {
11828
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
11829
        oprot.writeI64(this.success);
11830
        oprot.writeFieldEnd();
11831
      } else if (this.isSetPe()) {
11832
        oprot.writeFieldBegin(PE_FIELD_DESC);
11833
        this.pe.write(oprot);
11834
        oprot.writeFieldEnd();
11835
      }
11836
      oprot.writeFieldStop();
11837
      oprot.writeStructEnd();
11838
    }
11839
 
11840
    @Override
11841
    public String toString() {
11842
      StringBuilder sb = new StringBuilder("createRefund_result(");
11843
      boolean first = true;
11844
 
11845
      sb.append("success:");
11846
      sb.append(this.success);
11847
      first = false;
11848
      if (!first) sb.append(", ");
11849
      sb.append("pe:");
11850
      if (this.pe == null) {
11851
        sb.append("null");
11852
      } else {
11853
        sb.append(this.pe);
11854
      }
11855
      first = false;
11856
      sb.append(")");
11857
      return sb.toString();
11858
    }
11859
 
11860
    public void validate() throws TException {
11861
      // check for required fields
11862
    }
11863
 
11864
  }
11865
 
123 ashish 11866
}