Subversion Repositories SmartDukaan

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

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